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. How to prevent directory from being accessed by search engines?

    How to prevent directory from being accessed by search engines?

    Technical SEO Issues
    11 6 916
    • 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.
    • KTaylor
      KTaylor last edited by

      I'm assuming you want all search engines blocked from this directory. If so, edit your robots.txt file to state the following. This will block all bots from accessing a folder/directory on your site

      User-agent: *

      Disallow: /directoryname

      Xee 1 Reply Last reply Reply Quote 1
      • Xee
        Xee @KTaylor last edited by

        I don't have a robots.txt file in my root. Do I just create a text file, put the above lines into it, and upload it to my root after changing the name?

        Naghirniac Xee 3 Replies Last reply Reply Quote 0
        • edwardlewis
          edwardlewis last edited by

          shouldn't you put a slash at the end of the directory in the robots file?

          you can create the robots file through the Google Webmaster Tools

          KTaylor 1 Reply Last reply Reply Quote 1
          • Naghirniac
            Naghirniac @Xee last edited by

            If you don't have an robot.txt file, you need to include some important stuff first.

            First, do you have a sitemap.xlm for your website? If not, its very important and you should creat it at: http://www.xml-sitemaps.com/

            Create a robot.txt file and include the follow:

            User-agent: * allow: / disallow: /directoryname
            Sitemap: http://www.yousite.com/sitemap.xml

            With this you will inform all robots where is your sitemap. You should read more about robots.txt in this great post: http://www.seomoz.org/blog/robot-access-indexation-restriction-techniques-avoiding-conflicts

            1 Reply Last reply Reply Quote 1
            • Xee
              Xee @Xee last edited by

              As it is, my site is just phpBB3 forums (www.bearsfansonline.com); would a sitemap really help that much?

              1 Reply Last reply Reply Quote 0
              • KTaylor
                KTaylor @edwardlewis last edited by

                It's not required to have the ending slash. At least, it works for us without it.

                1 Reply Last reply Reply Quote 0
                • Naghirniac
                  Naghirniac @Xee last edited by

                  Xee,

                  It always help, and it is very easy to implement. This function to show the path to the sitemap ir very good.

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

                    The robots.txt file does not guarantee that your pages will not show up in search results! Your best bet after password protection is adding a NoIndex meta tag to you page headers.

                    Google have openly said that they obey this tag (Matt Cutts).

                    KTaylor 1 Reply Last reply Reply Quote 0
                    • KTaylor
                      KTaylor @A_Q last edited by

                      You're absolutely right! I left that part out. Thanks

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

                        But don't forget to remove that Disallow out of Robots.txt when you go live - if you want those pages to be indexed (and also the Meta-robots noindex nofollow).

                        Otherwise you might be pulling your hair out trying to figure out why none of your pages are getting indexed in the SERPs.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • How do I access the old search console?
                          NickSamuel
                          NickSamuel
                          0
                          6
                          70

                        • 301 redirect and search engines
                          timeintopixels
                          timeintopixels
                          0
                          5
                          83

                        • Site is not displaying in Search Engines
                          tpt.com
                          tpt.com
                          0
                          7
                          171

                        • Ranking on french search engine
                          oznappies
                          oznappies
                          0
                          12
                          1.4k

                        • Can Search engines crawl this page
                          AdamThompson
                          AdamThompson
                          0
                          4
                          972

                        • Search Engine Blocked by Robot Txt warnings for Filter Search result pages--Why?
                          languedoc
                          languedoc
                          0
                          5
                          915

                        • Search Engine blocked by robots.txt
                          Goetzman
                          Goetzman
                          0
                          7
                          1.2k

                        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