Title: Prefetching CDN again
Last modified: November 25, 2017

---

# Prefetching CDN again

 *  Resolved [larakim](https://wordpress.org/support/users/larakim/)
 * (@larakim)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prefetching-cdn-again/)
 * Hi there. This code has been working for a while, but after the latest update
   of wordpress, I see that it is prefetching CDN from here cdn.jsdelivr.net
    Its
   calling emojione.min.css and emojione.min.js. The code I have in my child theme
   functions is
 *     ```
       /**
        * Disable the emoji's
        */
       function disable_emojis() {
       	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_action( 'admin_print_styles', 'print_emoji_styles' );	
       	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
       	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );	
       	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
       	add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
       	add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
       }
       add_action( 'init', 'disable_emojis' );
   
       /**
        * Filter function used to remove the tinymce emoji plugin.
        * 
        * @param    array  $plugins  
        * @return   array             Difference betwen the two arrays
        */
       function disable_emojis_tinymce( $plugins ) {
       	if ( is_array( $plugins ) ) {
       		return array_diff( $plugins, array( 'wpemoji' ) );
       	} else {
       		return array();
       	}
       }
   
       /**
        * Remove emoji CDN hostname from DNS prefetching hints.
        *
        * @param  array  $urls          URLs to print for resource hints.
        * @param  string $relation_type The relation type the URLs are printed for.
        * @return array                 Difference betwen the two arrays.
        */
       function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {
   
       	if ( 'dns-prefetch' == $relation_type ) {
   
       		// Strip out any URLs referencing the WordPress.org emoji location
       		$emoji_svg_url_bit = 'https://s.w.org/images/core/emoji/';
       		foreach ( $urls as $key => $url ) {
       			if ( strpos( $url, $emoji_svg_url_bit ) !== false ) {
       				unset( $urls[$key] );
       			}
       		}
   
       	}
   
       	return $urls;
       }
       ```
   
 * It’s the latest from github as far as I can see. Any ideas what happens here?
   Thank you!!!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fprefetching-cdn-again%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [8 years ago](https://wordpress.org/support/topic/prefetching-cdn-again/#post-10168581)
 * Argghh, I never got a notification about your post. I just spotted it now when
   visiting the plugin page. I’m hectically busy right now, but I’ll look into this
   for you when I’m free. You’ve been waiting four months, so I guess another couple
   of days won’t matter :/ Sorry for the delay.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/prefetching-cdn-again/#post-10466536)
 * I didn’t find any reference to that domain name in WordPress at all.
 * Perhaps this is being added to your site by some other code?
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/prefetching-cdn-again/#post-10466541)
 * I’ve marked this as resolved since I failed to find any problem. If you can replicate
   this problem with a blank WordPress install, just reopen the thread and let me
   know where you found the domain listed, and I will take another look for you.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/prefetching-cdn-again/#post-10466545)
 * I suspect this problem is caused by using the jsdelivr CDN across your whole 
   site, and it’s interfering with the URLs used in the prefetch system and causing
   the plugin to keep fetching them.
    -  This reply was modified 7 years, 9 months ago by [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Prefetching CDN again’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/disable-emojis_d3c7d6.svg)
 * [Disable Emojis (GDPR friendly)](https://wordpress.org/plugins/disable-emojis/)
 * [Support Threads](https://wordpress.org/support/plugin/disable-emojis/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-emojis/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-emojis/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-emojis/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/prefetching-cdn-again/#post-10466545)
 * Status: resolved