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. Intermediate & Advanced SEO
    4. Indexing folders in google

    Indexing folders in google

    Intermediate & Advanced SEO
    6 4 424
    • 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.
    • Guest
      Guest last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • Train4Academy.co.uk
        Train4Academy.co.uk last edited by

        Hi,

        You can use the robot.txt to block unwanted sub domains and files from being indexed.

        For example if I have website on a url www.website.com and a sub domain such as sub.webiste.com, in that root file my robot.txt file would read:

        User-agent: *
        Disallow: /

        This will stop the sub domain sub.webiste.com from being indexed.

        Guest 1 Reply Last reply Reply Quote -1
        • GastonRiera
          GastonRiera last edited by

          Hi mmdemadi,

          If you want to prevent the whole subdomain from being indexed, there are a few actions you can do:

          • Prevent Google from crawling it, via a Robots.txt disallow rule. Remember that this only prevents Google from seeing your content, but if there are any outbound link to that subdomain, some pages might get indexed.
          • Meta tag robots noindex or x-robots, in HTTP header, noindex. This tells Google not to index, yet pages will be crawled. Here what Google says about noindex
          • If that information should not be public, then hide it behind a login. Google states that its the most effective and simplest method.

          Apart from these actions you may do, keep in mind that they work differently.
          As the easiest to do is to block in robots.txt, keep in mind that this won't remove whats previously indexed.
          In the case you want to block the whole subdomain and remove pages already indexed, I'd often suggest these steps:

          1. Don't block in robots.txt what you want to remove
          2. Add robots noindex tag and, if there are just a few, use the URL removal tool in Google Search Console
          3. Wait a few days and check that those pages don't appear in search
          4. Block that directory/subdomain in robots.txt

          Some further information:
          Robots.txt FAQ - Google Search Console Help
          Robots Meta Directives - Moz Learning Center
          Robots.txt best practices - Moz Learning Center

          Hope it helps.
          Best luck.
          Gaston

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

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Guest
              Guest @Train4Academy.co.uk last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • Rajesh.Prajapati
                Rajesh.Prajapati last edited by

                301 redirection is the best way to handle those sub-domain.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • My url disappeared from Google but Search Console shows indexed. This url has been indexed for more than a year. Please help!
                  jacobmartinnn
                  jacobmartinnn
                  0
                  3
                  74

                • Google Indexing
                  KHsdhkfn
                  KHsdhkfn
                  0
                  9
                  86

                • Google Indexing Stopped
                  Joe_Stoffel
                  Joe_Stoffel
                  0
                  2
                  64

                • Google index
                  DmitriiK
                  DmitriiK
                  0
                  7
                  169

                • "Null" appearing as top keyword in "Content Keywords" under Google index in Google Search Console
                  Tom-Anthony
                  Tom-Anthony
                  0
                  5
                  588

                • Google and PDF indexing
                  Christy-Correll
                  Christy-Correll
                  0
                  3
                  196

                • Google Indexed my Site then De-indexed a Week After
                  Jonathan1979
                  Jonathan1979
                  0
                  4
                  397

                • Indexing non-indexed content and Google crawlers
                  CleverPhD
                  CleverPhD
                  0
                  8
                  508

                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