Many were unhappy about the implementation of Emojis arriving with WordPress 4.2. While bloggers might be happy about Emojis, everyone building serious websites with WordPress will be especially frustrated about the Emoji JS code in the header and the fact that they can’t be disabled anywhere. Well, WordPress follows different aims apparently, even if I personally would especially prefer to see speed improvements implemented instead of another slowdown. But anyhow such small flaws are not harming the overall geniality and ease of WordPress that gets better and better with each update. After discovering the Emoji JS code I found a solution to simply put into each function.php of my child-themes, and my issue with Emojis is solved, thanks to Christine Cooper’s answer on stackexchange.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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' ); function disable_emojicons_tinymce( $plugins ) { if ( is_array( $plugins ) ) { return array_diff( $plugins, array( 'wpemoji' ) ); } else { return array(); } } |
There are also two plugins to have a look at, especially if you want to disbable the Emojis but still using the old Smileys.
This plugin that does actually what the code does: Disable Emojis.
Replacing the smilies with the original versions from previous versions of WordPress: Classic Smilies.
It can disable more of emojis function (new vers):
https://wordpress.org/plugins/disable-emojis-littlebizzy/