Remove Emoji javascript file in WordPress

WordPress supports emoji’s, these smiling faces, cats, dogs, planes, … and for your WordPress website to properly display them, a bit of extra code is added. If you wish to disable emoji support on your own WordPress blog, you want to remove this javascript file:

/wp-includes/js/wp-emoji-release.min.js

which dynamically loads these two files:

/wp-includes/js/twemoji.js

/wp-includes/js/wp-emoji.js

Personally, I disabled the emoji support because I do not use them and because it has a negative impact on the performance of my WordPress installation, such as increased load times and more HTTP requests to my server.

Because this javascript file is part of the WordPress code, you have to manually disable it by editing your functions.php file and by adding these files to the bottom:

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' );

This is the easiest way to get rid of these extra javascript files and to fully remove the emoji functionality on your WordPress website, without the need of any plugin.

 

Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.

 

2 thoughts on “Remove Emoji javascript file in WordPress

Leave a Reply

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