I have a WordPress site with a large user db more than 1 million users.
I am seeing a slow query in the logs and it looks like this:
SELECT wp_users.ID
FROM wp_users INNER JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id )
WHERE 1=1 AND (
( wp_usermeta.meta_key = ‘wp_user_level’ AND wp_usermeta.meta_value != ‘0’ )
)
ORDER BY display_name ASC
LIMIT 0, 50;
I want to find what is triggering it and stop it from executing this query. (Listing admins and authors is not something I’m intending on using.
I have already tried the below with no luck:
add_action(‘init’, function () {
foreach ([‘page’, ‘post’, ‘wh_jobs’, ‘wh_edu’, ‘wh_glossary’] as $type) {
remove_post_type_support($type, ‘author’);
}
});
I suspect that this is likely triggered by someone browsing posts or writing something in wp-admin
