Support » Plugins » robots noindex nofollow on dev or uat installs

  • Resolved boots



    I run my wp in,, and installs for production, user acceptable testing, and development.

    I’d like to create a conditional statement in header.php if I’m running the code on the uat or dev environments that outputs `echo ‘<meta name=”robots” content=”noindex,nofollow”> ‘

    I don’t want my uat and dev environment indexed and I don’t want to have individual robots.txt files.

    How can I test for subdomains or not main domain?

    Thanks in advance.


Viewing 2 replies - 1 through 2 (of 2 total)
  • I dug around a bit and got this to work by trial and error. I’m not the sharpest pencil in the pack. This a great feature for proper change management.

    The javascript tests if the hostname is not my production site, and if not it adds noindex, nofollow.

    Of course this goes in the <head> section where other meta calls are made.

    <script language="JavaScript">
    if (!(location.hostname == "")) {
      document.write ('<meta name="robots" content="noindex,nofollow">')



    Hey, you guys sound techie enough to ask about this noindex thing. Please, what and what should get the noindex box checked? Category, archive, tag or all of them. If so how will the search engines index my posts since I in categories?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘robots noindex nofollow on dev or uat installs’ is closed to new replies.