• Hello,

    I have an issue with emojis – i want to disable them and use smileys instead. I’ve applied this hook in functions.php , but for some reason it doesn’t work, emojis remain. Why? Is it possible to disable them without using a plugin?

    function disable_wp_emojicons() {
    
      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' );
    
      add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
    }
    add_action( 'init', 'disable_wp_emojicons' );
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Exactly how emojis are implemented has varied from version to version. The remove_* functions rely on exactly matching the add_* parameters. One minor change and the removal fails. You have to add code to remove emojis, whether it’s in a plugin or child theme.

    Of course the problem with repository plugins is they include extra code for user interface, etc. I suggest you find a currently working plugin, find out how they disable emojis, then replicate what they did in your own plugin or child theme. You just need the guts of the plugin that does the removal, not the extra UI etc. code. Some interpretation may be required, it’s not necessarily a simple copy/paste job.

Viewing 1 replies (of 1 total)
  • The topic ‘Disabling emojis’ is closed to new replies.