The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Block a sub-domain from being indexed

    Block a sub-domain from being indexed

    Technical SEO Issues
    7 6 13.1k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kchandler
      kchandler last edited by

      This is a pretty quick and simple (i'm hoping) question. What is the best way to completely block a sub domain from getting indexed from all search engines?

      One item i cannot use is the meta "no follow" tag.

      Thanks! - Kyle

      1 Reply Last reply Reply Quote 0
      • kennyrowe
        kennyrowe last edited by

        Block using your robots.txt page.

        kchandler 1 Reply Last reply Reply Quote 1
        • kchandler
          kchandler @kennyrowe last edited by

          That was going to be my assumption but i wasn't 100% sure how they worked with sub domains. Are you able to supply a little more information on implementation? It is extremely important that it only blocks: sub.domain.com and not domain.com

          john4math Oversteer 2 Replies Last reply Reply Quote 0
          • john4math
            john4math @kchandler last edited by

            Each subdomain may have its own robots.txt file.  So for that subdomain, you can put:

            User-agent: *
            Disallow: /
            

            In the robots.txt, and that should do it.

            Please note that disallowing pages in robots.txt will not necessarily mean they won't appear on search result pages.... if people link to pages that are disallowed on that subdomain, they can still appear in SERPs.  I had this happen with a few pages, which leads to funny listings in the SERPs because Google has to guess what the page title and description of the page should be, since it's not allowed to read the page.  The meta noindex tag is the way to go if you want to be really sure the page doesn't appear in the SERPs.  If you use that, don't disallow the page.  Here's a recent SEOMoz post about it: http://www.seomoz.org/blog/robot-access-indexation-restriction-techniques-avoiding-conflicts

            1 Reply Last reply Reply Quote 1
            • Oversteer
              Oversteer @kchandler last edited by

              In subdomain.example.com/robots.txt add the statements:

              User-agent: *
              Disallow: /

              Warning: Be absolutely certain that the above statements are not included in your example.com/robots.txt file or you'll kill your site.

              1 Reply Last reply Reply Quote 0
              • bloggidy
                bloggidy last edited by

                The robots.txt file just tells the bots you would "prefer" they don't index but there is nothing to prevent them from indexing.The only sure way to do this is to restrict access to the sub-domain for everyone and require some sort of authentication. If they don't have access they can't index.

                1 Reply Last reply Reply Quote 1
                • X-X
                  X-X last edited by

                  Keep in mind that Google Index's everything that it can crawl.  Even if you put a block in the robots.txt they will probably crawl it.  You can require a password to that subdomain and keep big G out.  This is easy to do if you have a site with cpanel access.  Just go to manage permissions, and password protect that director with a .htaccess pw.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  • Is repurposing an old sub domain better than creating a new sub domain?
                    VeroBrain
                    VeroBrain
                    1
                    2
                    66

                  • Domain vs Sub Domain and Rankings
                    kwoolf
                    kwoolf
                    0
                    6
                    97

                  • Correct linking to the /index of a site and subfolders: what's the best practice? link to: domain.com/ or domain.com/index.html ?
                    CleverPhD
                    CleverPhD
                    0
                    4
                    245

                  • Will Links to one Sub-Domain on a Site hurt a different Sub-Domain on the same site by affecting the Quality of the Root Domain?
                    ifbyphone
                    ifbyphone
                    0
                    5
                    153

                  • How to prevent duplicat content issue and indexing sub domain [ CDN sub domain]?
                    Dr-Pete
                    Dr-Pete
                    0
                    3
                    328

                  • Sub-domain or sub-folder for a blog?
                    TomRayner
                    TomRayner
                    0
                    2
                    133

                  • Using hyphenated sub-domains or non-hyphenated sub-domains? What is the question! I Any takers?
                    dcmike
                    dcmike
                    0
                    11
                    5.5k

                  • Redirecting root domains to sub domains
                    Yozzer
                    Yozzer
                    0
                    4
                    804

                  Get started with Moz Pro!

                  Unlock the power of advanced SEO tools and data-driven insights.

                  Start my free trial
                  Products
                  • Moz Pro
                  • Moz Local
                  • Moz API
                  • Moz Data
                  • STAT
                  • Product Updates
                  Moz Solutions
                  • SMB Solutions
                  • Agency Solutions
                  • Enterprise Solutions
                  • Digital Marketers
                  Free SEO Tools
                  • Domain Authority Checker
                  • Link Explorer
                  • Keyword Explorer
                  • Competitive Research
                  • Brand Authority Checker
                  • Local Citation Checker
                  • MozBar Extension
                  • MozCast
                  Resources
                  • Blog
                  • SEO Learning Center
                  • Help Hub
                  • Beginner's Guide to SEO
                  • How-to Guides
                  • Moz Academy
                  • API Docs
                  About Moz
                  • About
                  • Team
                  • Careers
                  • Contact
                  Why Moz
                  • Case Studies
                  • Testimonials
                  Get Involved
                  • Become an Affiliate
                  • MozCon
                  • Webinars
                  • Practical Marketer Series
                  • MozPod
                  Connect with us

                  Contact the Help team

                  Join our newsletter
                  Moz logo
                  © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                  • Accessibility
                  • Terms of Use
                  • Privacy