禁止WordPress头部加载s.w.org

Home / Article MrLee 2016-9-14 2900

升级到WordPress 4.6之后,有童鞋发现头部加载了一个“<link rel='dns-prefetch' href='//s.w.org'>”,WordPress在头部添加dns-prefetch,应该是为了从s.w.org预获取表情和头像,目的是提高网页加载速度 ,但s.w.org国内根本无法访问,什么预获取、什么提高速度,都是泡影,不仅没用处,反而可能会影响速度,那就禁止它。
// Remove emoji script
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
add_filter( 'emoji_svg_url', '__return_false' );

实测有效,转自知更鸟博客

本文链接:https://www.it72.com/10102.htm

推荐阅读
最新回复 (0)
返回