Checking Blog Privacy Settings

As a result of last nights post, I dove in and added a check to my Robots Meta plugin that checks whether you’re allowing search engines to spider your site.

If not, it’ll throw an ugly warning on each and every page until you fix it:

The code for it is easy, and as I’d like other plugins to start using it as well, let me give it to you here:

function blog_public_warning() {
  if ( '0' == get_option('blog_public') ) {
    echo "<div id='message' class='error'><p>";
    echo "<strong>Robots Meta Issue: You're blocking access to robots.</strong>";
    echo " You must <a href='options-privacy.php'>go to your Privacy settings</a>";
    echo " and set your blog visible to everyone.";
    echo "</p></div>";
add_action('admin_footer', 'blog_public_warning');

That’s easy enough, I think each and every WordPress plugin to do with SEO should do this check, to be honest.

29 Responses

  1. Hameedullah Khan
    By Hameedullah Khan on 31 December, 2009

    Nice tip! I agree that every SEO plugin should do this check.

    • Debjit
      By Debjit on 3 January, 2010

      Totally agree with you and Joost, this is one basic thing that every SEO plugin should implement for more user awareness. These days everyone is taking to wordpress blogging and they add plugins blindly. SO having such a warning message is always helpful for users!

  2. David Westeirnk
    By David Westeirnk on 31 December, 2009

    SEO 1-on-1 I think… And it’s so easy to do… I can’t think of a reason to have a SEO plugin when you don’t want your site crawled by bots in the first place though….

  3. Kenneth Dambo
    By Kenneth Dambo on 31 December, 2009

    The point is that those who do install an SEO plugin wants to be crawled an indexed for sure and to ensure that this check is crusial due to “removing indexing barriers” being the first step in SEO.

  4. Dennis Whiteman
    By Dennis Whiteman on 31 December, 2009

    That’s an important thing. While developing one of my sites, I had the setting in WordPress set so that the dev site wasn’t being crawled. When the launched in June, I couldn’t figure out why our traffic was down so dramatically and my client was trying to blame WordPress. It turned out that I forgot to switch the visibility setting under privacy on and, so where we were at the top of the search rankings, we no longer existed to Google and the others. It took us about a week to recover and a month or so for our traffic levels to get back to normal levels.

    • Joost de Valk
      By Joost de Valk on 31 December, 2009

      it happens to everyone :)

  5. Nicolas
    By Nicolas on 31 December, 2009

    Same as Dennis – I launched a new WordPress site a few weeks ago ; still not indexed, checked everything (robots, meta tages, title)… except index/follow metas… That cannot be that as I knew how WordPress works…
    Thanks for the tip !

  6. Maynem
    By Maynem on 31 December, 2009

    nice feature. its highlighting the finer details which i find important. For example on all in one seo pack it can be easy to forget to no index the tag archives.

  7. Roy Huiskes
    By Roy Huiskes on 31 December, 2009

    Great! This actually solves occasional problems after an update.

  8. Steve
    By Steve on 1 January, 2010

    Thanks for the tip, I assumed if you did not manually block access the site was indexed.

  9. Tim
    By Tim on 2 January, 2010

    Thanks for the tip. When I create a new site I sometimes change category names and post names etc. as I add the initial content because I often refine my ideas when I start to see the site take shape. I tend to switch off ‘allow search engines’ until I have stopped changing things as they might index a page or a category that no longer exists. Would you say that was good practice?

  10. vinay
    By vinay on 2 January, 2010

    Great Article!!!!!!!!! will come back for more

  11. Mike
    By Mike on 3 January, 2010

    I can see why you added it, but it would be really cool if there was a (hidden?) option to remove the notice. I use this plugin to keep my blog off the internets, and it does a pretty darn good job. Thank you for that.

    I could remove the code by hand, but I’d have to do this every time you updated the plugin, which is a hassle. Please?

    • Mike
      By Mike on 14 January, 2010

      Bump! Did you see my comment, Joost?

      • Eric B
        By Eric B on 19 January, 2010

        I think its fault to rely on no-index to keep your page out of search results.. But even so it would be nice to have the option to hide the message.

  12. Nic James
    By Nic James on 3 January, 2010

    BTW, in the Google Analytics plugin settings, under Advanced settings, the phrase below has a typo:

    Not recommended, as this would schew your statistics.

    Schew should be skew.

    thanks for the plugins man, love your work

    (oh and text appears to overlap the right border of this comment box if you type until the letters wrap. this corrects itself, but certainly is odd behaviour. is this some sort of CSS background issue?)


  13. Tony
    By Tony on 4 January, 2010

    Great tip and I love the warning message. There is nothing worse than having a public blog and making the simple mistake of not allowign it to be indexed. Happy New Year and keep up the good work.

  14. LA
    By LA on 4 January, 2010

    We need the google sitemap plugin to respect the noindex when generating the sitemaps! Or is there a way to do this; anyone know?

  15. 113Tidbits
    By 113Tidbits on 5 January, 2010

    Thanks for the check. I usually “cheese” up the privacy settings but with this, I may not have to worry any more.

  16. arsenal
    By arsenal on 6 January, 2010

    That is a nice little addition Yoast. I saw a comment on your Facebook post about webdesigner mag issue, so this should alert people well enough about that.
    I would only change teh wording, because you have all kinds of people who would freak out from words: “You’re blocking access to robots.” :)
    Maybe changing it to “You’re blocking your site from showing up in search engine results.” might be better.

  17. vincent
    By vincent on 9 January, 2010

    Great plugin mate, have been using it to manage meta tags on several sites.

  18. Anonymous Programmer
    By Anonymous Programmer on 9 January, 2010

    I just started using your Robots Meta plugin, and I love it. *This time* I had already remembered to check my privacy settings, but I’ve forgotten in the past (haven’t we all?). Here’s to making life easier!

  19. tweeter auto man
    By tweeter auto man on 10 January, 2010

    I must download this plugin – I already use your Analytics which is cool.

    Thank you for these plugins.

  20. Tom - marketing tips
    By Tom - marketing tips on 14 January, 2010

    Cool plugin! I have a WordPress blog by use a normal robots.txt file.Perhaps the plugin would do a better job.

  21. Tyrone
    By Tyrone on 15 January, 2010

    This is helpful for refining your blog details as well. Thanks for the codes! Having similar situations on having your blog indexed seems unnoticed and this plugin is a good solution.

  22. Emmanuel
    By Emmanuel on 18 January, 2010

    Nice Tip.

    Just realized I wasn’t letting search engines spider one of my sites- a wrong robots.txt configuration was the culprit. The Robots Meta Plugin is simply amazing.


    PS: BTW, Have you considered adding the option for users to be able to edit their robots.txt file directly from the Robots Meta Plugin dashboard (like you did with the .htaccess file)- would be a great feature, that is, if it’s possible.

  23. Joshua Patton
    By Joshua Patton on 25 January, 2010

    I can see how this could be a big issue. Myself I am just starting to understand SEO, I have taken a few of the recommended changes. I noticed that because I forgot to block search engines that I was indexed part way through development, or rather redevelopment since we already had a site, but it was not based on WP.
    Great ideas by the way on using .htaccess files to redirect from old pages to the new ones in WP so as to not lose incoming links.

  24. san
    By san on 27 January, 2010

    I’ve try this tips, but i am still confuse about this tips because i’m a newbie.