问题
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:
- How do I stop Wordpress from inserting a noindex meta tag?
- Wordpress remove Robots Meta Tag noindex
- Cannot remove action noindex in wordpress
来源:https://stackoverflow.com/questions/51064267/how-do-i-stop-wordpress-from-inserting-a-noindex-meta-tag