Admin slow on Postlist (over 30k Posts in Database)

we have a Site with around 20k Posts in the normal postlist and another 10k in other CPT. The custom post types work really fast, but the normal Post List doesn't. I assume that might be because the server aggregates how many posts are published, how many are mine and how many are deleted, but I'm not really sure about that.

Any idea how to limit what is being queried - I looked in google how to remove sections from the query but all I find is css hacks to not display the filters, not how to remove them from the query.

if you have any other ideas, please let me know.

Topic wp-admin posts custom-post-types Wordpress

Category Web


Perhaps this filter can help you to modify the query for the specific post type and inside wp-admin

as per the documentation, this filter is called before the query is executed so you can modify/optimize the query with the help of this filter.

do_action_ref_array( 'pre_get_posts', WP_Query $query )

further reference: https://developer.wordpress.org/reference/hooks/pre_get_posts/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.