The Rendering Optimization module is designed to improve page load performance by optimizing how JavaScript, fonts, and images are loaded. This module includes four configuration tabs: JavaScript, Resources, Fonts, and Lazy Load.
This tab contains options for optimizing JavaScript loading strategies to improve page render performance.
Description: Adds the defer attribute to all eligible JavaScript files.
How it works:
Use case: Recommended for most non-critical JavaScript that doesn't need to execute immediately on page load.
Default: Disabled
Description: Delays JavaScript execution until user interaction or timeout.
How it works:
type="text/plain" to prevent execution, then converts back when readyUse case: Highly effective for below-the-fold scripts, analytics, and non-critical third-party scripts.
Default: Disabled
Description: Maximum time (in milliseconds) to wait before loading delayed scripts.
Range: 500 - 5000 ms (default: 1000 ms)
How it works:
Default: 1000 (1 second)
Description: Moves eligible JavaScript files from the to the footer of the page.
How it works:
Safe list (automatically excluded):
jquery, jquery-core, jquery-migratejquery-ui-core, jquery-ui-tabs, jquery-ui-accordionDefault: Disabled
Description: Automatically excludes critical scripts from delay functionality.
How it works: Prevents the following from being delayed:
Default: Enabled (recommended for e-commerce sites)
Description: Custom exclusion list for JavaScript files that should not be optimized.
How to use:
contact-form-7, some-plugin-script.jsDefault: Empty
Pattern matching support:
jquerygoogle-analyticscdn.example.com/script.js/^analytics.*\.js$/This tab handles resource preloading and fetchpriority attributes for critical resources.
Description: Adds fetchpriority attributes to critical resources.
How it works:
Default: Disabled
Description: Adds headers for critical resources.
How it works:
Default: Disabled
Description: Define custom rules for resources that should receive high priority.
Configuration fields:
.featured-image, #logo)img, script, or linkhigh or lowglobal, homepage, single, page, or archiveExample rules:
URL: /wp-content/themes/mytheme/hero-image.jpg Type: img Priority: high Condition: homepage
Description: Define resources to preload on specific pages.
Configuration fields:
global, homepage, single, page, archive)Example:
URL: https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap Condition: global
Description: Automatically adds fetchpriority="high" to featured images on singular posts.
How it works:
This tab optimizes font loading for better performance and reduced layout shifts.
Description: Adds font-display: swap CSS property to font stylesheets.
How it works:
display=swap to Google Fonts URLsSupported font services:
Default: Disabled
for Google Fonts domainsdisplay=swap to Google Fonts requestsfont-display: swap to @font-face rulesThe system automatically detects font stylesheets based on:
google-fonts, font-awesome, roboto, open-sans, montserrat, etc.fonts.googleapis.com, fonts.gstatic.com, fontawesome.comThis tab controls lazy loading for images, iframes, and videos.
Description: Adds loading="lazy" attribute to images and enables JavaScript-based lazy loading.
How it works:
src with data-src and sets placeholder SVGdecoding="async" for off-main-thread decodingdevdoit-lazy class for stylingImage processing:
![]()
tags, adding loading="lazy" if missingsrc to data-src for JS-based loadingsrcset by converting to data-srcsetdecoding="async" attributedevdoit-lazyDefault: Disabled
Default: Disabled
Description: Number of first images to exclude from lazy loading (LCP protection).
How it works:
Example:
1 means only the first image on each page is excluded2 excludes first two images (e.g., featured image + first content image)Default: 0 (no exclusion)
Recommendation: Set to 1 to prevent the featured image from being lazy loaded.
Description: Prevents critical above-the-fold images from being lazy loaded.
How it works:
fetchpriority="high" are automatically excludedThe module automatically disables optimization on:
| Optimization | Impact | Use Case |
|---|---|---|
| Defer JS | High | Most sites |
| Delay JS | Very High | Content-heavy sites |
| Font Swap | Medium | Sites using web fonts |
| Lazy Load Images | Very High | Image-heavy sites |
| Preload | Medium | Critical resource optimization |
| FetchPriority | Medium | LCP optimization |
If scripts don't load after enabling delay/defer:
If using Font Display Swap causes layout shifts:
font-display: optional insteadIf LCP score worsens after enabling Lazy Load:
fetchpriority="high"