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