WordPress 4.2 + has added Emoji to the WordPress core. If you do not want or need Emoji it is best to remove/dequeue Emoji styles and scripts for better performance (less JavaScript and CSS = a good thing!). To remove Emoji from your WordPress site, copy and paste this code snippet — in plain text — to your functions.php file, or, add it with a plugin like Code Snippets.
The fastest possible version of your website is no longer optional. We can help! Learn more…
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' );
RECENT POSTS
Comments 14
really simple code, but is working for me… thank bro
Author
Glad it worked out for you, Aan!
Have fun,
Derrick B.
Client Support Representative
WpFASTER
Where do you put this code?
Thanks! Nice and efficient. I appreciate tips like this.
this is greate tutorial men….thanks alot..
you can also follow this code for better result……
function disable_wp_emojicons() {
// remove all actions related to emojis
remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ );
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( ‘wp_mail’, ‘wp_staticize_emoji_for_email’ );
remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ );
remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ );
}
add_action( ‘init’, ‘disable_wp_emojicons’ );
Thanks, it works.
Fantastic post, well done, keep it up. the method of writing is nice. Thanks for sharing here
Actually the complete function to disable emojis would be:
function wp_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’, ‘wp_disable_emojis’);
Removing emojis is a sound decision performance wise. However, if you want to get rid of all emojis due to design inconsistencies, using the plugin discussed or extending your functions-file is just part of the equation. People will still be able to use Emoji characters. Whether these are displayed properly depends on native support (http://caniemoji.com/). The only solution is to use a regular expression matching the Unicode emoji list and then replace them with your own for a unified look (isn’t WordPress trying to do that?) or remove them from the string altogether. Emojis have changed the way we communicate, love them ❤️ or hate them ?.
Awesome. Worked for me and now the score in webpagespeedtest is A A A A A grade. Hmmmm
Thanks bro.
Great code work for my site. thank you for sharing a great code.
hello,
for WP5 is same Emojis delete script to?
maybe there are additions?
Worked for me. Page Loading time is fast now.
Thanks
Code is working fine as page load is fast.. Thanks for code
This crash after upgrade to PHP 8.0 ,
I remove the code temporarily