[Plugin: WP Sitemap] [Solved] Slow-down due to count calculation
-
Replace the following lines in function get_page_count
//global $wpdb; //$parsed_sql = explode('LIMIT', $sql); //$query_count = $wpdb->get_results($parsed_sql[0], OBJECT);
with this
$total_published = wp_count_posts()->publish; return ($total_published/$post_count);
The caveat is that this will only work if you are using “posts” only option. But this will greatly speed up the sitemap generation especially for large number of posts.
Great plugin! Keep up the good work!
- The topic ‘[Plugin: WP Sitemap] [Solved] Slow-down due to count calculation’ is closed to new replies.