Go to the top

Code Snippett: Remove emoji code in your WordPress header, no plugin

In version 4.2, WordPress added emoji support automatically. For those sites already using emoji plugins or styles it caused a number of issues. For those sites that don’t use emoji it’s an unnecessary script adding (albeit miniscule) load time.

You don’t need a plugin to remove this code. Just add the following code into your child theme functions.php file:

// Remove WP emoji in header
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');

remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );