To remove the emoji scripts from the head of your WordPress site, you can use the remove_action()
function. This function allows you to remove an action hook that has been registered with WordPress.
To remove the emoji scripts, you can use the following code in theme functions.php:
// Remove emoji scripts from WordPress head
// More snippets at wpunplugged.com
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
Note that this code will only remove the emoji scripts from the head of your site. If you also want to disable the emoji feature completely, you can add the following code to your site’s wp-config.php
file:
// Remove emoji scripts from WordPress head
// More snippets at wpunplugged.com
define( 'DISABLE_WP_EMOJI', true );
This will disable the emoji feature completely, including the conversion of emoji characters to images in the content of your site.