Support » Plugin: W3 Total Cache » remove emojis and google fonts?

  • Resolved bulls_shark


    Hello there is the option – remove emojis, – optimize and remove google fonts?

    Or is this planned?

    If not, can someone tell me how to solve it?

    Thanks for your support!

Viewing 3 replies - 1 through 3 (of 3 total)
  • bgdstr


    Unfortunately no, there is no option to that. This will be discussed internally and perhaps in the later releases this will be added.
    However, you can remove those by adding :


    add_action(‘init’, ‘disable_emoji’);
    function disable_emoji() {
    // 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’);
    add_filter( ‘tiny_mce_plugins’, array(static::class, ‘disableEmojisTinyMCE’) );
    add_filter(‘wp_resource_hints’, array(static::class, ‘removeDnsPrefetch’), 10, 2);
    To the function.php

    I hope this helps.

    Hello thanks for the code, with a little customization it worked.

    Thanks for the quick support

    //Disable emoji
    add_action( 'init', 'disable_emoji' );
    function disable_emoji() {
      // 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' );
       // new filter to remove TinyMCE emojis
      add_filter( 'tiny_mce_plugins', 'disable_tiny' );
       //new filter to remove dns prefetch
      add_filter( 'emoji_svg_url', '__return_false' );
    function disable_tiny( $plugins ) {
      if ( is_array( $plugins ) ) {
        return array_diff( $plugins, array( 'wpemoji' ) );
      } else {
        return array();
    Plugin Support Marko Vasiljevic


    Hello @bulls_shark,

    Thank you for your feedback. Its good to know that your solution worked. Please take some time and rate our plugin 5 stars at your convenience.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘remove emojis and google fonts?’ is closed to new replies.