Title: Plugin generates excessive database queries
Last modified: October 24, 2023

---

# Plugin generates excessive database queries

 *  [Mark Howells-Mead](https://wordpress.org/support/users/markhowellsmead/)
 * (@markhowellsmead)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/)
 * After experiencing performance problems with my site(s), I’ve tracked the problem
   down to this plugin. When active in a website running the Site Editor, it runs
   around 500 additional database queries on the search page.
 * A regular call to the search page without the plugin active runs around 60-70
   database queries. When the plugin is active, it varies between 550-600 queries.
   Using Query Monitor to analyse them, it seems that these additional queries are
   almost all to `WP_Term_Query->get_terms()`, which is called (on average) 393 
   times.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplugin-generates-excessive-database-queries%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Munir Kamal](https://wordpress.org/support/users/munirkamal/)
 * (@munirkamal)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17146160)
 * Thank you for reporting the issue. I will investigate the problem and get back
   to you with updates soon.
 *  Thread Starter [Mark Howells-Mead](https://wordpress.org/support/users/markhowellsmead/)
 * (@markhowellsmead)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17146167)
 * Thank you for your swift response.
 *  [Zofster](https://wordpress.org/support/users/zofster/)
 * (@zofster)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17464187)
 * +1 I have same problem.
 * Any solutions?
 * Best regards, Zlatan
 *  [Zofster](https://wordpress.org/support/users/zofster/)
 * (@zofster)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17464511)
 * I just back to version 1.40.4 and reduced number of Queries from 664 to acceptable
   196.
 * Seems that Block Styles Manager is involved.
 *  [intmanu](https://wordpress.org/support/users/intmanu/)
 * (@intmanu)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17535295)
 * Hi,
 * I too have the same problem. Is there any solution for this?
 *  [robruifrok](https://wordpress.org/support/users/robruifrok/)
 * (@robruifrok)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17710841)
 * Same here. I get an out memory error or a timelimit error. The problem is in 
   the Gutenberghub_Styles_Manager_Blocks class. Switching off the styles manager
   or commenting out the wp_insert_term function in the code solves the problem.
 * Looking further I found that get_terms() with ‘fields’ set to ‘count’ gives a
   number of more than 250000.
 * To get at least some terms returned I have to limit the number.
 * Setting fields to ‘id=>name’ or ‘id=>slug’ gives odd results for name or slug.
 *  [robruifrok](https://wordpress.org/support/users/robruifrok/)
 * (@robruifrok)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17712440)
 * Some additional info:
 * In my case the problem was caused by the plugin ‘User Access Manager’ (UAM).
 * In UAM->Settings->Taxonomies settings select ‘Blocks’ in the select field and
   make sure you set ‘Hide empty Blocks’ to ‘no’.
 * If in UAM ‘Hide empty Blocks’ is set to ‘yes’ and in Editorskit ‘Styles manager’
   is switched on, Editorskit multiplies the terms for the taxonomy ‘Blocks’ (name
   =>gsm_block) on every page load resulting in the described problems.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Plugin generates excessive database queries’ is closed to new replies.

 * ![](https://ps.w.org/block-options/assets/icon-256x256.jpg?rev=2610578)
 * [Gutenberg Block Editor Toolkit – EditorsKit](https://wordpress.org/plugins/block-options/)
 * [Support Threads](https://wordpress.org/support/plugin/block-options/)
 * [Active Topics](https://wordpress.org/support/plugin/block-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-options/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [performance](https://wordpress.org/support/topic-tag/performance/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * 7 replies
 * 5 participants
 * Last reply from: [robruifrok](https://wordpress.org/support/users/robruifrok/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/plugin-generates-excessive-database-queries/#post-17712440)
 * Status: not resolved