Query Monitor – WP Comments with a lot of unnecessary queries
-
LOVE THIS PLUGIN! Great work!
I have a few loops running on a custom page (custom-page.php), here is an example:
<?php start_short(); ?> [loop exists trim=true type=unit taxonomy=tax-name-one term=term-one relation=and taxonomy_2=tax-name-two term_2=term-two] [the-loop] ... Some Mixed HTML [field custom_name escape=true] [title] etc... [/loop] <?php end_short(); ?>
When I use Query Monitor plugin, there are a TON of unnecessary “WP_Comment_Query->get_comment_ids()” queries.
Example:
SELECT wp_comments.comment_ID FROM wp_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 212 ORDER BY wp_comments.comment_date_gmt DESC
There are 162 total queries on the (entire) page, with 72 of them being attributed to this WP_Comment_Query. Is there anyway in the shortcodes to pass an argument to disable looping through comments?
When I looked through the Documentation, under the Advanced Markdown i.e. “if it exists” it lists a bunch of fields like Featured Image and if the post has any attachments, along with comments. I would expect Featured Images and attachments would have the same unnecessary queries, but they don’t, so I am suspecting that something is defaulting to always query comments.
(The irony is that my site is 0 comments, and comments are disabled, so you can see why it’s troubling me.)
Thanks for any help you can provide, and thanks for a great plugin!
- The topic ‘Query Monitor – WP Comments with a lot of unnecessary queries’ is closed to new replies.