How to Disable Emojis in WordPress 4.2
October 23, 2015 / by Peter Johnson / Categories : Keeping A Clear HeadDisable the Emojicons for your WordPress site / theme
Since the release of version 4.2 , WordPress now allows you to add new Emojicons to your posts.
WordPress Codex: Introduction To Emoji
Emojis are the tiny icons or smileys used on the internet. Originating from Japan, Emoji have made their way into the unicode character set, iOS, Android, and even on desktop computers.
It is possible to switch these off in the WordPress admin panel, but you still will have the emojicons styles and JavaScript auto-enqueued in the header of your theme.
For those of us who know how to code snippets to the WordPress functions file we can add the following snippet to remove this.
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’ );
Function Version
function remove_emojicons() { // Remove from comment feed and RSS remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); // Remove from Emails remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); // Remove from Admin area remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'admin_print_styles', 'print_emoji_styles' ); // Remove from the head, i.e. wp_head() remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); // Remove from Print-related CSS remove_action( 'wp_print_styles', 'print_emoji_styles' ); } add_action( 'init', 'remove_emojicons' );
If you don’t know how to do this then you can use a wordpress plugin.
0 comments