How to Disable Emojis in WordPress

1. Install and activate the Disable Emojis plugin.

2. Go to Settings > Disable Emojis.

3. Check the box to disable the loading of emojis.

4. Click the “Save Changes” button.

5. Emojis will now be disabled on your WordPress site.

There are a lot of web performance optimizations and tweaks you can do to make your WordPress site load faster.  One easy optimization is to disable emojis from loading. Emojis are little icons used to express ideas or emotions. While these icons are fun and all, are they really necessary for your WordPress site? Especially if you are a business, these are simply adding additional load time which is unnecessary.

When they released WordPress 4.2, they added support for emojis into core for older browsers. The big issue with this is that it generates an additional HTTP request on your WordPress site to load the wp-emoji-release.min.js file. And this loads on every single page. While this file is only 10.5 KB, things like these add up over time.

wp emoji release file

Disable Emojis in WordPress

There are a couple different ways to disable Emojis in WordPress. You can do it with a free plugin or with code.

1. Disable Emojis in WordPress With Plugin

The first way to disable emojis is to simply use a free plugin called Disable Emojis, developed by Ryan Hellyer.

disable emojis wordpress plugin

This plugin is super lightweight, only 9 KB to be exact. As of writing this, it currently has over 30,000 active installs with a 5 out of 5-star rating. Note: Emoticons and emojis will still work in browsers which have built-in support for them. This plugin simply removes the extra JavaScript file that is used to add support for emojis in older browsers.

You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins. There is nothing to configure, simply install, activate, and the additional JavaScript file will be gone.

There is also a free alternative plugin called Emoji settings. This was built with Multisite in mind and gives the user an option to disable Emoji’s themselves.

emoji settings

You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins. Once activated, the user can check or uncheck “Enable emoji support” from within the Writing settings in their WordPress dashboard.

You could also use a premium plugin like perfmatters (developed by a team member at Kinsta), which allows you to disable emojis along with other optimizations for your WordPress site.

Disable emojis in perfmatters plugin
Disable emojis in perfmatters plugin

2. Disable Emojis in WordPress With Code

If you don’t want to install another plugin, you can also just disable emojis with code. Start by creating a backup of your site, and then create a child theme so your changes aren’t overwritten if you update your WordPress theme. Then, add the following to your WordPress child theme’s functions.php file. Note: code sourced from Disable Emoji’s plugin above.

Important! Editing the source code of a WordPress theme could break your site if not done correctly. If you are not comfortable doing this, please check with a developer first.

/**
 * Disable the emoji's
 */
function disable_emojis() {
 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' ); 
 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' );
 add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
 add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
}
add_action( 'init', 'disable_emojis' );

/**
 * Filter function used to remove the tinymce emoji plugin.
 * 
 * @param array $plugins 
 * @return array Difference betwen the two arrays
 */
function disable_emojis_tinymce( $plugins ) {
 if ( is_array( $plugins ) ) {
 return array_diff( $plugins, array( 'wpemoji' ) );
 } else {
 return array();
 }
}

/**
 * Remove emoji CDN hostname from DNS prefetching hints.
 *
 * @param array $urls URLs to print for resource hints.
 * @param string $relation_type The relation type the URLs are printed for.
 * @return array Difference betwen the two arrays.
 */
function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {
 if ( 'dns-prefetch' == $relation_type ) {
 /** This filter is documented in wp-includes/formatting.php */
 $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' );

$urls = array_diff( $urls, array( $emoji_svg_url ) );
 }

return $urls;
}

Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Get started with a free trial of our Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.



Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

Contact
San Vito Al Tagliamento 33078
Pordenone Italy
Item added to cart.
0 items - 0.00
Open chat
Scan the code
Hello 👋
Can we help you?