Lighten scripts: defer, ?ver=, emoji, embeds
At the top of the “Assets” panel sit four switches that are independent of one another; below them follows the card “Browser cache (.htaccess)”. The four switches change how WordPress includes scripts and which standard outputs are generated in the <head> at all. Every switch takes effect immediately after you flip it; there is no save button.
Working through the switches in order
- The “Assets” panel sits in the sidebar in the group “Speed”.
- The entry JavaScript “defer” loads non-critical scripts with a delay; jQuery stays exempt. Switched on out of the box.
- “Remove query strings” strips the ?ver= from CSS and JS addresses. Switched off out of the box.
- “Remove emoji script” deregisters the emoji detection script and the styles that belong to it. Switched on out of the box.
- “Disable embeds” removes wp-embed.js and the oEmbed discovery links. Switched off out of the box.
What defer actually touches
Only scripts that are loaded via a src attribute are deferred. Scripts that already carry defer or async, as well as the jQuery core library, remain unchanged. In the admin area the change does not take effect.
Emoji and embeds in detail
- Emoji: the detection script, the emoji styles, the replacement in feeds and the editor's wpemoji plugin are deregistered, in the front end as well as in the admin area
- Embeds: wp-embed.js is taken out of the queue again in the footer, the oEmbed discovery links and the oEmbed host script in the <head> are dropped