WordPress has great emoji support in core. For older browsers that do not support emoji’s, it uses a JavaScript and CSS fallback. This is great as everyone gets a consistent user experience. However, many do not like having a script and style loaded in the header of their website. This is because not everyone uses the script or wants them on their website. Therefore I am going to show you how to remove emoji scripts and styles in WordPress without a plugin.
Step 1: Open your functions.php file. Or an existing kitchen sink plugin.
This code can be added to your functions.php file, or to an existing plugin that is on your website (A kitchen sink plugin, if you would).
Step 2: Insert the following code to remove emoji scripts.
You could also add this to a theme, if you are wanting to add it as an option! Anyways, the below code will remove any trace of the scripts and styles for WordPress’ emoji’s.
remove_action( 'wp_head', 'print_emoji_detection_script', 10 ); 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' );
If you have any questions on where to put this code, please feel free to ask them below or contact us and I will be able to help you!