How to Disable Emojis in WordPress

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.

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 here is a plugin to disable emojis in WordPress or you can use the functions.php snippet below.

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.

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.

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();
}
}

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.