How to prevent wordpress multisite to generate queries for each blog?

I have a multisite installation and I have a performance issues, because there is too much queries. When I inspect the queries, I see that there is a queries for each blog. It doesn`t metter what I am loading.

[141] => Array
    (
        [0] => SELECT * FROM wp_blogs WHERE blog_id = 61 /* get_blog_details */
        [1] => 0.0010240077972412
        [2] => require('path-to-rootwp-blog-header.php'), require_once('path-to-rootwp-includestemplate-loader.php'), do_action('template_redirect'), call_user_func_array, _wp_admin_bar_init, WP_Admin_Bar->initialize, get_blogs_of_user, get_blog_details
    )

[142] => Array
    (
        [0] => SELECT option_name, option_value FROM wp_61_options WHERE autoload = 'yes'
        [1] => 0.0028109550476074
        [2] => require('path-to-rootwp-blog-header.php'), require_once('path-to-rootwp-includestemplate-loader.php'), do_action('template_redirect'), call_user_func_array, _wp_admin_bar_init, WP_Admin_Bar->initialize, get_blogs_of_user, get_blog_details, switch_to_blog, WP_Roles->reinit, get_option, wp_load_alloptions
    )

There is a queries for each blog.

Read More

Do you have an idea how to stop them?

Related posts

Leave a Reply