我们在使用WordPress程序的时候会发现,WordPress网站会加载很多外部资源,导致网站加载速度很慢,为了加快访问,我们一起了解一下WordPress后台如何禁止加载会影响网站速度的外部资源?

它们分别是以下这些加载项:
//禁止WordPresO = n R ^ #s头部加载s.w.org
function remo^ ` A ? 0 Z +ve_dns_prefetch( $hints, $relation_type ) {
if ( ‘dns-prefetch’ ==i 7 r N A= $rel[ N V ` ; ! O M Hation_typ7 j ; l e h g je ) {
return array_diff( wp_dependencies_unique_hosts(), $hints );
}
return $hints;
}
add_filter( ‘wp_resource_hints’, ‘remove_dns_prefe= s L 1 ftch’, 10, 2 );
// Remove emoji script
remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 );
remove_action( ‘wp_print_c U n y I B :styles’, ‘printK l Q c 1 K_emoji_styles’ );
add_filter( ’emoji_svg_url’, ‘__return_false’ );

