Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Recently my hosting automatically upgraded our Wordpress version. Due to custom plugin conflicts, we requested them to restore it to the previous version.

Our homepage now contains the code "meta name='robots' content='noindex,nofollow' /" (< removed). From Googling, it appears that this code should be added when I visit the Privacy section of Wordpress and select "I would like to block search engines, but allow normal visitors".

However, my site is selected as "I would like my site to be visible to everyone, including search engines (like Google, Bing, Technorati) and archivers".

I also understand that by default, Wordpress chooses the first option, blocking search engines. I think that at some point during the restore to a previous version, Wordpress has got stuck in the blocking search engine mode. Changing privacy is having no affect on the code.

I need a manual way to remove "meta name='robots' content='noindex,nofollow' /" from the homepage - I have no idea where the code is located though.

share|improve this question
    
Try header.php in your theme file. –  Andrew Bartel May 28 '13 at 4:32
add comment

1 Answer

The setting is stored in the options table under the key blog_public, the value is either 0 or 1. You can see the value of all options by manually visiting the page /wp-admin/options.php.

A quick way to get rid of it would be to remove the noindex action hooked to wp_head, which is what outputs that tag if blog_public is 0:

remove_action( 'wp_head', 'noindex', 1 );

This behavior is a bit strange though, I suspect perhaps something else may be involved here beyond simply the value of this option.

share|improve this answer
    
blog_public is 1. –  user33364 May 28 '13 at 4:39
    
try adding the remove_action bit to your theme's functions.php –  Milo May 28 '13 at 4:41
    
In any particular section of functions.php, or just at the end? –  user33364 May 28 '13 at 4:43
    
at the end is fine. you can also try getting the value of the option directly in a template file to check if that also gives you 1, or perhaps something is filtering the result: echo get_option( 'blog_public' ); –  Milo May 28 '13 at 4:46
    
Sorry, I do not know how to do that. Where do I enter the echo? In a php file? I have never done that before. –  user33364 May 28 '13 at 4:52
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.