admin管理员组

文章数量:1122846

strangely my theme doesn't have the function that generates queries like this

SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment') ORDER BY post_modified_gmt DESC LIMIT 1

however after I checked

mysql -e "show full processlist"

it has too many queries above

Is there any way to prevent this query from happening, it really overloads the website

Thank you very much

strangely my theme doesn't have the function that generates queries like this

SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment') ORDER BY post_modified_gmt DESC LIMIT 1

however after I checked

mysql -e "show full processlist"

it has too many queries above

Is there any way to prevent this query from happening, it really overloads the website

Thank you very much

Share Improve this question asked Mar 31, 2024 at 15:15 Công Tử HuyếtCông Tử Huyết 134 bronze badges 4
  • Have you contacted the theme author? Just because you got the theme from a repo or a third-party site like ThemeForest, it doesn't mean it follows best practices. – Tony Djukic Commented Apr 1, 2024 at 0:55
  • @Tony Djukic my theme was developed and written from scratch by me – Công Tử Huyết Commented Apr 1, 2024 at 3:05
  • Ah, I misunderstood - are there any plugins installed? Go through your theme and disable queries in case any of them are doing so without your knowledge. – Tony Djukic Commented Apr 1, 2024 at 12:36
  • @Tony Djukic, I think is core wordpress – Công Tử Huyết Commented Apr 2, 2024 at 5:13
Add a comment  | 

1 Answer 1

Reset to default 1

Searching on Google for the mentioned query, I believe your assumption that it is coming from WordPress is correct. This ticket can be found at https://core.trac.wordpress.org/ticket/31171.

In my opinion, you should check what requests are coming to your website and block bad bots/users who are making multiple requests (based on that ticket, probably you have multiple RSS feed requests).

Thank you,

本文标签: theme developmentDisable creating sort index SELECT postmodifiedgmt