by Oxford Metadata Ltd on WordPress.org
Boost site speed with static menu caching. Lazy-load submenus to keep DOM size under 1,500 nodes for better Core Web Vitals.

Admin settings page - Configure your menu and CSS options
Menu Optimizer is a powerful performance optimization plugin that generates static HTML files for your WordPress menus, dramatically reducing server load and improving page load times.
Real-World Success: This optimization technique helped achieve the first WooCommerce store with a perfect 100/100 mobile score on Google PageSpeed Insights. Read the WP Rocket case study
Why Menu Caching Matters
Menu generation requires significant compute time on WordPress and WooCommerce sites. Every page load requires WordPress to:
* Query the database for menu items
* Process menu hierarchy
* Apply filters and hooks
* Render HTML output
Menu Optimizer eliminates this overhead by pre-generating menu HTML files that are served instantly.
The DOM Size Problem
Google Lighthouse triggers warnings when a page exceeds 1,500 DOM nodes (HTML elements). For e-commerce sites with extensive product categories:
Menu Optimizer’s lazy loading keeps your initial DOM size under 1,500 nodes by loading only top-level items (typically 50-100 elements). Submenus load on-demand, maintaining excellent performance.
Key Features
Performance Benefits
✓ Keeps DOM size under Google’s 1,500-node limit with lazy loading
✓ Reduces server CPU usage by offloading menu generation
✓ Decreases Time To First Byte (TTFB)
✓ Improves Core Web Vitals scores (LCP, CLS, INP)
✓ Reduces database queries per page load
✓ Compatible with WP Rocket, W3 Total Cache, and other caching plugins
Perfect For
Proven Results
This menu optimization technique was used in a WooCommerce store that achieved a 100/100 Google PageSpeed mobile score.
Learn more: WP Rocket Case Study – 100/100 Mobile Score for WooCommerce
Developed by Oxford Metadata Ltd
Contact: dimitris.vayenas@oxfordmetadata.co.uk
Special thanks to the WordPress community for their valuable feedback and contributions.
For support, please visit the WordPress.org support forum or contact us at dimitris.vayenas@oxfordmetadata.co.uk.
This plugin:
* Does not collect any user data
* Does not make external API calls
* Does not use cookies
* Stores cached menu files locally on your server
* Uses localStorage only for client-side caching (optional)
File Structure:
* Top menu file – Loads instantly with page (minimal HTML)
* Full menu file – Lazy loads on first interaction (complete with submenus)
* CSS options – None, Max Mega Menu auto-detect, or custom
* Storage location – wp-content/uploads/menu-optimizer/
Browser Compatibility:
* Chrome 90+
* Firefox 88+
* Safari 14+
* Edge 90+
Server Requirements:
* PHP 7.4 or higher
* WordPress 5.8 or higher
* Write permissions to uploads directory