Optimise page code
Page code is slimmed down as it leaves for the visitor, without changing your files. Turning optimisation off gives you back the exact same site.
Part of the Performance & SEO pack.
On this page
Turn optimisation on#
- Open Performance, then Details on the site you want.
- Under Code optimization, click Turn on optimization.
The home page is checked right after: if it no longer responds, optimisation turns itself off again.
The options#
Recommended settings gathers the safe options, already ticked:
| Option | Effect |
|---|---|
| Minify HTML | Removes comments and needless spaces. |
| Load images on demand | Off-screen images wait until they’re seen. The first two are protected. |
| Inline small CSS files | Fewer files blocking display. |
| Remove unused Gutenberg CSS | Only on pages with no blocks at all. |
| Show text without waiting for fonts | Adds font-display: swap. |
| Non-blocking Google Fonts | The font arrives without blocking display. |
| Preconnect and preload | Anticipates important resources. |
| Browser cache | Visitors keep CSS, JavaScript, images and fonts for a year (Apache or LiteSpeed). |
| Disable WordPress emojis | Removes the detection script. |
| Elementor optimizations, Optimize Complianz | Settings specific to these plugins. |
Check on the site after turning on gathers the riskier options:
| Option | Risk |
|---|---|
| Defer JavaScript | Often a big gain, to check on the site. jQuery, Elementor, WooCommerce, payment and consent are never deferred. |
| Remove jQuery Migrate | May break an old theme or plugin. |
| Disable WordPress embeds | Links to other WordPress sites no longer show as cards. |
What is never touched#
Logged-in visitors, the WooCommerce cart, checkout and account, previews, 404 errors and feeds. The slightest error leaves the page intact.
Exclude a page or a script#
Under Exclusions:
- Pages not to optimize: one address per line, from the start of the path.
*replaces any sequence. - Scripts not to defer and Stylesheets not to inline: one piece of address per line.
Several sites#
Settings are specific to each site. Once a site is right, Copy these settings to all my other sites applies them elsewhere, without turning optimisation on where it’s off.
To turn optimisation, the static cache or WebP images on or off on several sites at once:
- On the Performance page, tick the sites in the table.
- Choose the Action and the Affected sites: The checked sites or all the sites with a tag.
- Click Apply, then confirm.
Sites are handled one after the other, with the same checks as from their own page. The first ones are processed straight away, the rest in the background: the table updates by itself. A refused site, for example because a competing plugin runs on it, keeps the reason on its row without holding up the others. A site that doesn’t respond is retried several times.
If something’s wrong#
Turn off optimization gives you back the exact same site. In an emergency, define('SITUNIO_CONNECTOR_NO_PERFORMANCE', true); in wp-config.php turns everything off.
Still have a question? Write to us.