宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

虽然 Emoji 表情很可爱,但是也有很多人并不需要。为了支持这些 Emoji 表情,WordPress 会在每一个页面上额外加载一个 JavaScript 文件,而且这些代码会加载大量的图片资源,拖慢网站的速度。而且 WordPress 默认使用的表情库在国内无法正常访问,更是大大的拖慢了网站的访问速度。当然,如果你依然想在国内使用这些表情也不是没有办法,可以通过更换 Emoji 表情 CDN 服务器的方法解决无法访问。

把如下代码copy到当前主题的functions.php文件即可

//移除Wordpress的Emoji表情
remove_action 'admin_print_scripts', 'print_emoji_detection_script');
remove_action 'admin_print_styles', 'print_emoji_styles');
remove_action 'wp_head', 'print_emoji_detection_script', 7);
remove_action 'wp_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');