Page load delays traced to uncached/unbatched queries in theme code

Hello,

We're seeing significant load times on our site ([Links visible only for registered users]) — 3.5 to 15+ seconds per page, including plain wp-admin pages. Database time itself is low (under 1 second); the delay is in PHP execution. A single page load can generate ~8,000 database queries, ~98% of which Query Monitor flags as exact duplicates.

Using Query Monitor's "Duplicate Queries" view (with third-party plugins disabled via troubleshooting mode, to rule out plugin conflicts), we traced two theme-specific causes:

1. Header menu built twice, uncached between renders

update_meta_cache() for the same set of menu-item post IDs runs 4 times per page load (0.82s total), attributed to sc_header_menu() and sc_header_burger(). It looks like desktop and mobile menu rendering each independently re-fetch the full menu meta instead of sharing one cached result.

2. Attachment/thumbnail meta fetched one image at a time

Each course-grid thumbnail triggers multiple separate queries (WP_Post::get_instance(), update_meta_cache() via mfn_get_attachment_data(), has_post_thumbnail(), get_post_thumbnail_id()) instead of a single batched update_meta_cache() call for all attachment IDs before the loop — with 30+ images this multiplies into hundreds of small queries.

Questions:

  • Is this a known issue, and is there a fix/updated version that batches menu and attachment meta lookups?
  • Any setting to make BeTheme prime the meta cache for a full post/attachment batch upfront rather than per item?

Happy to share full Query Monitor exports if useful. Thanks in advance.

Comments

  • Hey,

    Please send us the WordPress dashboard and FTP access privately through the contact form, which is on the right side at [Links visible only for registered users] and we will check what might be the reason.

    Notice!

    Please attach a link to this forum discussion.

    Sending incorrect or incomplete data will result in a longer response time.

    Therefore, please ensure that the data you send are complete and correct.

    Thanks

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.