WordPress includes an emoji compatibility layer so older browsers can display modern emoji consistently. On a current browser, the feature usually performs a support check and does no further work. If a site does not need that fallback, you can remove its front-end script and styles, but the result is a small cleanup rather than a major performance strategy.
What the WordPress emoji feature loads
In WordPress 6.8.1, core attaches print_emoji_detection_script to wp_head. That function prints an inline loader and a settings object. The loader tests what the browser supports and can request the bundled wpemoji or combined fallback source when required. The settings also identify WordPress-hosted image locations used by the fallback.
Core also enqueues a small inline style through wp_enqueue_emoji_styles. The older print_emoji_styles callback remains connected for backwards compatibility: the newer enqueue function checks that callback and removes it as part of its normal flow. This detail matters because many old snippets mention only the deprecated callback without explaining why the hook is still present.
Separate filters convert emoji for feeds and email, and WordPress adds emoji handling to embedded post output and parts of the administration area. You do not have to remove every one of those paths to clean up the public page. Decide whether your goal is only the normal front end or the complete compatibility feature.
How much difference does it make?
The front-end change removes inline code and avoids a possible fallback request on browsers that fail the support test. It can make the document head easier to inspect and remove work the site does not need. On a typical modern WordPress page, however, it is modest compared with full-page caching, server response time, large media, web fonts, third-party scripts, or heavy plugin assets.
This is why I treat emoji removal as maintenance after larger bottlenecks have been addressed. The value is clearest on a deliberately lean site where every optional output is reviewed, or where a policy requires the browser not to contact the fallback image host. It should not be sold as a dramatic shortcut to a high score.
Measure the complete change. Compare the HTML and Network panel before and after, then repeat the same lab test several times. If the only result is a cleaner head and one less compatibility check, that can still be worthwhile when the rule remains simple and documented.
How to disable emoji assets safely
The following example removes public-page, embed, feed, and email compatibility hooks. Place it in a small functionality plugin, an MU plugin, or a child theme that you control. Do not paste it into WordPress core or the main file of a third-party plugin because an update can overwrite it.
add_action( 'init', function () {
// Normal front-end pages.
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
// Embedded post documents.
remove_action( 'embed_head', 'print_emoji_detection_script' );
remove_action( 'enqueue_embed_scripts', 'wp_enqueue_emoji_styles' );
// Feeds and email.
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
} );
Removing print_emoji_styles from wp_print_styles also signals the current wp_enqueue_emoji_styles function not to enqueue the replacement style on the public page. That behaviour reflects the current core implementation and should be rechecked when WordPress changes the emoji pipeline.
If you only care about normal public pages, keep the first two removals and omit the embed, feed, and email lines. If you also intend to remove the feature from the Dashboard, use the corresponding admin_print_scripts, admin_print_styles, and admin_enqueue_scripts hooks only after testing the block and classic editors. A narrow scope is easier to maintain.
Asset CleanUp also exposes WordPress cleanup settings, including emoji removal, so a site already using it may not need custom code. Choose one owner for the change. Duplicating the same cleanup in a plugin, theme, and performance tool makes future debugging unnecessarily confusing.
Other optional WordPress assets worth reviewing
Emoji is only one optional feature, but every item has a different compatibility boundary.
| Feature | When it may be unnecessary | Check before removal |
|---|---|---|
| Dashicons for guests | The theme and public plugins use their own icons | Menus, account links, plugin widgets, and responsive controls |
| Comment Reply script | Comments or threaded replies are disabled | Every post type that accepts comments and reply links |
| Embed discovery and host script | The site neither embeds WordPress URLs nor lets others embed its posts | Existing editorial embeds and external consumers |
| Feed links | The site has a deliberate policy not to publish feeds | Readers, newsletter tools, integrations, and sitemap assumptions |
| Shortlink, RSD, and generator metadata | No workflow or external client uses the discovery output | Publishing tools and remote integrations |
Dashicons deserves particular care. WordPress uses the icon font throughout the Dashboard, and themes or plugins sometimes use it on the public site. A common optimisation is to dequeue it only for logged-out visitors, but that rule is safe only when public components have been inspected at every breakpoint.
WordPress embeds can turn a pasted URL into rich content and allow eligible WordPress posts to be embedded elsewhere. Removing only a discovery link, removing the host script, and disabling embed handling are different changes. Define which behaviour you want before copying a snippet that removes all three.
What not to disable blindly
The REST API supports the block editor and many plugins, applications, and front-end features. Heartbeat supports autosave, post locking, session checks, and plugin behaviour. XML-RPC may be unused on one site and required by a publishing app or connected service on another. These are application interfaces, not decorative lines in the document head.
The same rule applies to jQuery, block styles, global styles, and WordPress dependency handles. A coverage report taken before opening a menu or form cannot prove that a dependency is unused. Remove a narrowly understood asset or adjust how it loads only after identifying its owner and testing all relevant states.
For a broader decision process, see plugins and assets in the safe WordPress performance guide. Larger gains usually come from correcting a measured bottleneck instead of collecting the longest possible list of disabled features.
How to verify the result and roll it back
-
Capture the current output
Save the page source or note the emoji settings and style handles before the change. Keep a copy of the code or setting you are about to alter.
-
Apply the rule in a controlled place
Use staging where possible. Clear the page, server, CDN, and browser caches involved in the test.
-
Inspect public pages
Confirm the detection script and emoji style are absent. Test desktop and mobile pages while logged-out, including navigation, forms, comments, and any emoji used in content.
-
Test the scope you removed
If the snippet covers feeds, email, embeds, or administration screens, test each of those outputs rather than assuming the front page proves they work.
-
Retain a one-step rollback
Disable the setting or remove the snippet, clear the same caches, and confirm WordPress restores its default output. Record why the cleanup exists and when it was reviewed.
Keep cleanup measurable
Review optional WordPress output from one place
Asset CleanUp can remove emoji support and other optional output while also showing the CSS and JavaScript loaded by individual pages. Test each change before visitors receive it.
Great snippet. Thanks
Thanks for this but it seems your forgot to mention that another amazing plugin named “Asset Cleanup” is also doing the job…;)
It would be nice to have a subscription box for your blog posts!
Why not? Is this intentional?
I’m very Happy to use Asset CleanUp. 🙂