How do I stop Wordpress from inserting a noindex meta tag?

梦想与她 提交于 2019-12-29 08:24:15

问题


I'm trying to get my website to be indexed by search engines. According to this, something from Wordpress is injecting a meta tag that's preventing search engines from crawling my site: https://aw-snap.info/file-viewer/?protocol=secure&tgt=chrispokey.com

I'm beginning to think it's something to do with the wp_head(); function. What next steps can I take to remove the noindex tag that's somehow getting inserted in my website's header section?

Thanks!

<?php
    if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
    wp_head();
    ?>

回答1:


Please visit Settings » Reading and make sure you don't have checkbox checked near the "discourage robots" setting.




回答2:


🥳 I found a solution that worked for me here: 👉 https://wordpress.org/support/topic/disable-noindex-on-certain-core-pages-2/

add_action( 'init', 'remove_wc_page_noindex' );
function remove_wc_page_noindex(){
    remove_action( 'wp_head', 'wc_page_noindex' );
}

This question appears to be on three threads:

  1. How do I stop Wordpress from inserting a noindex meta tag?
  2. Wordpress remove Robots Meta Tag noindex
  3. Cannot remove action noindex in wordpress


来源:https://stackoverflow.com/questions/51064267/how-do-i-stop-wordpress-from-inserting-a-noindex-meta-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!