How to Disable Emojis in WordPress (Easy Step-by-Step Guide)

If you’re looking to speed up your site as fast as possible you may have noticed the wp-emoji-release.min.js file loading on all of your pages. This is WordPress’ emoji support which is enabled by default since WordPress 4.2.

Key Takeaways
  • Disabling emoji support does not stop emojis working. Every modern browser renders them natively.
  • The saving is smaller than most guides claim: about 1.2 KB of inlined JavaScript, not the 22 KB figure you will see quoted.
  • The real cost being removed is the canvas-based support test the loader runs on every page load.
  • Most snippets miss the oEmbed hooks, so the emoji script keeps loading inside embed iframes.
  • A plugin and a code snippet do the same job. Use the snippet if you would rather not add a plugin for eight lines of code.

This javascript adds an unnecessary file to your page load. In addition to the page speed implications it runs a regex on the entire page which can be intensive on low powered devices, slowing your site down even more.

wp-emoji-release.min.js request shown in browser network tab
wp-emoji-release.min.js request on WordPress sites

Most WordPress users do not need WordPress support and it just ends up slowing down your site so we recommend you disable emojis in WordPress.

Many performance plugins (like WP-Rocket) will also give you the option to disable emojis. If you aren’t currently disabling Emojis this guide will show you a plugin to disable emojis in WordPress. I’ll also show you a code snippet to use in your functions.php to disable Emoji support as well.

What You Actually Save

Worth being straight about the numbers, because most guides on this topic are not.

WordPress ships two emoji files. wp-emoji-loader.min.js is about 2.9 KB raw and 1.2 KB gzipped, and it is inlined into the head of every page. wp-emoji-release.min.js is the big one at roughly 22 KB raw and 5.4 KB gzipped, and it is the number everyone quotes.

Here is the part that usually gets left out: the big file only downloads if your visitor’s browser fails the emoji support test. The loader draws emoji to a canvas and compares the pixels to work out whether the browser can render them natively. Every current browser passes, so on a modern device that 22 KB file is never requested. Quoting it as your saving is not accurate.

What you genuinely remove is the 1.2 KB of inlined loader, one DNS prefetch to s.w.org, and the canvas test itself. That last one is the most interesting: it is main-thread work running during page load on every single view. Small, but it is real, and unlike most micro-optimisations it costs you nothing.

So this is worth doing, just do not expect it to move your page speed score on its own. It is one of the free ones.


Video Tutorial

Here’s my quick video guide to disabling emojis in WordPress.


Disable WordPress Emojis with Plugin

The quickest and easiest way to disable emojis in WordPress is to use the Disable Emojis plugin. This is as simple as installing the plugin and activating it and poof! emoji support is gone.

If you head to Plugins/Add new in your WordPress dashboard and search “Disable Emojis” you’ll quickly find the plugin. Just click Install then Activate and emoji support will be removed from WordPress.


Disable WordPress Emojis with Functions.php Code

The code below will disable emojis in WordPress and can be used in your theme’s function.php. This is the more developer friendly approach.

You can also use this snippet in the Code Snippets WordPress plugin which allows you to easily add code snippets to your WordPress site.

add_action( 'init', 'smartwp_disable_emojis' );

function smartwp_disable_emojis() {
	// Front end and admin
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	remove_action( 'wp_print_styles', 'print_emoji_styles' );
	remove_action( 'admin_print_styles', 'print_emoji_styles' );

	// oEmbed iframes load their own copies. Most snippets miss these two.
	remove_action( 'embed_head', 'print_emoji_detection_script' );
	remove_action( 'enqueue_embed_scripts', 'wp_enqueue_emoji_styles' );

	// Feeds and outgoing 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' );

	// Classic editor plugin
	add_filter( 'tiny_mce_plugins', 'smartwp_disable_emojis_tinymce' );

	// The DNS prefetch hint left behind for s.w.org
	add_filter( 'wp_resource_hints', 'smartwp_remove_emoji_dns_prefetch', 10, 2 );
}

function smartwp_disable_emojis_tinymce( $plugins ) {
	return is_array( $plugins ) ? array_diff( $plugins, array( 'wpemoji' ) ) : array();
}

function smartwp_remove_emoji_dns_prefetch( $urls, $relation_type ) {
	if ( 'dns-prefetch' !== $relation_type ) {
		return $urls;
	}
	$emoji_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/' );

	return array_filter(
		$urls,
		function ( $url ) use ( $emoji_url ) {
			$href = is_array( $url ) ? ( $url['href'] ?? '' ) : $url;
			return false === strpos( $href, $emoji_url );
		}
	);
}

Two lines in there are missing from almost every version of this snippet you will find elsewhere: the embed_head and enqueue_embed_scripts removals. WordPress registers emoji support separately for oEmbed iframes, so without those the script keeps loading whenever your posts are embedded.

You may also notice older snippets only remove print_emoji_styles from wp_print_styles, even though WordPress 6.4 moved emoji CSS to a newer wp_enqueue_emoji_styles function. Those snippets still work, and it is worth knowing why: core deliberately checks whether print_emoji_styles is still hooked and bails out early if you have removed it. The back-compat is intentional, so there is no need to chase the newer hook on the front end.


How to Check That It Worked

Load any page on your site in a private window, view source, and search for emoji. If it worked you will find nothing. Before the change you would see an inline script block containing wpemojiSettings near the top of the head.

Use a private window or purge your cache first. A cached copy of the page will happily keep serving the old markup and make you think the snippet failed.

Frequently Asked Questions

Will emojis stop working in my posts?

No, and this is the most common worry about it. Emoji are ordinary Unicode characters, and every current browser and operating system renders them without help. What you are removing is a compatibility layer that swapped emoji for images on browsers too old to display them, which in practice means browsers almost nobody still uses. Type an emoji into a post after disabling this and it will look exactly the same.

Plugin or code snippet, which is better?

They do the same job, so it comes down to preference. A plugin is easier to reverse and survives a theme change, which matters if someone else maintains the site. The snippet avoids adding a whole plugin for what amounts to eight lines of code. If you already run a performance plugin such as WP Rocket, check its settings first, since disabling emoji is usually a checkbox there and you do not need either option.

Where should the snippet go?

Not in your parent theme’s functions.php, because a theme update will erase it. Use a child theme, a small custom plugin, or a snippets plugin such as Code Snippets. Our guide to adding code snippets to WordPress covers the trade-offs of each.

Does this help Core Web Vitals?

Marginally, and mostly on the responsiveness side rather than loading. Removing the loader takes a small amount of scripting off the main thread during page load, which nudges Interaction to Next Paint in the right direction. It will not change your Largest Contentful Paint, because that is almost always an image. Treat it as tidying rather than a fix: if your scores are poor, images and render-blocking CSS are where the actual problem is.


Just like that you’ve disabled emojis on your WordPress site. While this is only one small part of improving your site’s performance I highly recommend doing it. Be sure to check out more of our tips to speed up WordPress.

Picture of Andy Feliciotti

Andy Feliciotti

Andy has been a full time WordPress developer for over 15 years. Through his years of experience has built 100s of sites and learned plenty of tricks along the way. Found this article helpful? Buy Me A Coffee

6 Responses

  1. Thanks, i really needed that. I used the snippet as a extra Plugin is a bit too much in my eyes.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Tips Monthly
Get the latest from SmartWP to your inbox.