Disable the Emoji Script in your WordPress Template header.php file

Disable the Emoji Script in your WordPress Template header.php file

How to Disable the Emoji in your Custom WordPress Template?


You can disable and remove the script that adds additional javascript to your final code in your header.php and the emojis.


What is the emoji’s

The Emoji in WordPress are small digital images or icons used to express an idea or emotion — to your website, pages, and posts. For best performance and from Page Speed Improvements it is a good idea to disable the script to speed up the load time for your pages and website on both mobile and desktop devices.

// Remove Emoji

function disable_wp_emojicons() {

  // 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’ );

  // filter to remove TinyMCE emojis
  add_filter( ‘tiny_mce_plugins’, ‘disable_emojicons_tinymce’ );
}
add_action( ‘init’, ‘disable_wp_emojicons’ );


blockquote