我最近注意到我的html源上显示了一些内容。它们在这里。
<!-- This site is optimized with the Yoast WordPress SEO plugin v2.1.1 - https://yoast.com/wordpress/plugins/seo/ -->
<meta name="robots" content="noindex,follow"/>
<script type=\'application/ld+json\'>{"@context":"http:\\/\\/schema.org","@type":"WebSite","url":"https:\\/\\/kl.ncc.my\\/","name":"NCC KL \\/ Selangor"}</script>
<!-- / Yoast WordPress SEO plugin. -->
<script type="text/javascript">
window._wpemojiSettings = {"baseUrl":"https:\\/\\/s.w.org\\/images\\/core\\/emoji\\/72x72\\/","ext":".png","source":{"concatemoji":"https:\\/\\/kl.ncc.my\\/wp-includes\\/js\\/wp-emoji-release.min.js?ver=4.2.1"}};
!function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f;c.supports={simple:d("simple"),flag:d("flag")},c.supports.simple&&c.supports.flag||(f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
我已经检查了所有的插件,我找不到删除它们的地方。这里有人面临同样的问题吗?我只想显示机器人元标记。只是为了删除上面剩下的编码。有什么解决方案吗?
最合适的回答,由SO网友:m4n0 整理而成
Emoji
是WordPress 4.2核心中新增的功能,与WP SEO代码无关。您可以在函数中使用此删除操作来删除这些。php
Code Update
- Christine Cooper的回答如下:Disable Emojis 处理整个网站的所有表情符号内容。
function disable_wp_emojicons() {
// 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\' );
// filter to remove TinyMCE emojis
add_filter( \'tiny_mce_plugins\', \'disable_emojicons_tinymce\' );
}
add_action( \'init\', \'disable_wp_emojicons\' );
或使用此插件:
Disable Emojis