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.
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.
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.
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.
<?php | |
//Disable emojis in WordPress | |
add_action( 'init', 'smartwp_disable_emojis' ); | |
function smartwp_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_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
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' ); | |
} | |
function disable_emojis_tinymce( $plugins ) { | |
if ( is_array( $plugins ) ) { | |
return array_diff( $plugins, array( 'wpemoji' ) ); | |
} else { | |
return array(); | |
} | |
} |
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.
4 Responses
Thanks, i really needed that. I used the snippet as a extra Plugin is a bit too much in my eyes.
Does this disable them in form submissions?
Hello Andy,
that was exactly the code snippet I was looking for.
Thank you very much for publishing!
Kind regards,
Boris
doesn’t work for me