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. Robots.txt best practices & tips

    Robots.txt best practices & tips

    Technical SEO Issues
    4 2 3.2k
    • 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.
    • JonathanRolande
      JonathanRolande last edited by

      Hey,

      I was wondering if someone could give me some advice on whether I should block the robots.txt file from the average user (not from googlebot, yandex, etc)?

      If so, how would I go about doing this? With .htaccess I'm guessing - but not an expert.

      What can people do with the information in the file? Maybe someone can give me some "best practices"? (I have a wordpress based website)

      Thanks in advance!

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

        There is really no reason to block the robots.txt file from human users, Jazy. They'll never see it unless they actively go looking for it, and even if they do, it's just directives for where you want the search crawlers to go and where you want them to stay away from.

        The only thing a human user will learn from this, is what sections of your site you consider to be nonessential to a search crawler. Even without the robots file, if they were really interested in this information, they could acquire it in other ways.

        If you're trying to use your robots.txt file to block information about pages on your website you want to keep private or you don't want anyone to know about, doing it in the robots.txt file is the wrong place anyway. (That's done in .htaccess, which should be blocked from human readers.)

        There's enough complexity to managing a website, there's no reason to add more by trying to block your robots file from human users.

        Hope that helps?

        Paul

        JonathanRolande 1 Reply Last reply Reply Quote 1
        • JonathanRolande
          JonathanRolande @ThompsonPaul last edited by

          Thanks for the detailed answer Paul! 🙂

          Do you think there is anything I should block for a wordpress website? I blocked /admin.

          ThompsonPaul 1 Reply Last reply Reply Quote 0
          • ThompsonPaul
            ThompsonPaul @JonathanRolande last edited by

            Asking about the ideal configuration for a robots.txt file for WordPress is opening a huge can of worms 🙂 There's plenty of discussion and disagreement about exactly what's best, but a lot of it depends on the actual configuration and goals of your own website. That's too long a discussion to get into here, but below is what I can recommend as a pretty basic, failsafe version that should work for most sites:

            Disallow: /cgi-bin/
            Disallow: /wp-admin/
            Disallow: /wp-includes/
            Disallow: /wp-content/plugins/
            Disallow: /wp-content/cache/
            Disallow: /wp-content/themes/

            Sitemap: http://www.yoursite.com/sitemap.xml

            I always prefer to explicitly declare the location of my site map, even if it's in the default location.

            There are other directives you can include, but they depend more on how you have handled other aspects of your website - e.g. trackbacks, comments and search results pages as well as feeds. This is where the list can get grey, as there are multiple ways to accomplish this, depending how your site is optimised, but here's a representative example.

            Disallow: /trackback/
            Disallow: /feed/
            Disallow: /comments/
            Disallow: /category//
            Disallow: /trackback/
            Disallow: /feed/
            Disallow: /comments/
            Disallow: /
            ?

            Disallow: /
            ?

            Sorry I can't be more specific on the above example, but it's where things really come down to how you're managing your specific site, and are a much bigger discussion. A web search for "best WordPress robots.txt file" will certainly show you the range of opinions on this.

            The key thing to remember with a robots.txt file is that it does not cause blocked URLs to be removed from the index, it only stops the crawlers from traversing those pages. It's designed to help the crawlers spend their time on the pages that you have declared useful, instead of wasting their time on pages that are more administrative in nature. A crawler has a limited amount of time to spend on your site, and you want it to spend that time looking at the valuable pages, not the backend.

            Paul

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Should you use robots.txt for pages within your site which do not have high quality content or are not contributing a great deal so when Google crawls your site the best performing content has a higher chance of being indexed?
              Jacksons_Fencing
              Jacksons_Fencing
              0
              5
              44

            • Meta Robots Noindex and Robots.txt File
              Devanur-Rafi
              Devanur-Rafi
              0
              2
              125

            • A few misc Webmaster tools questions & Robots.txt etc
              Dan-Lawrence
              Dan-Lawrence
              0
              5
              127

            • Best use of robots.txt for "garbage" links from Joomla!
              Cyrus-Shepard
              Cyrus-Shepard
              0
              6
              410

            • BEST Wordpress Robots.txt Sitemap Practice??
              evolvingSEO
              evolvingSEO
              0
              2
              1.7k

            • Mobile SEO Tips and Best Practices
              skrauss
              skrauss
              0
              8
              3.5k

            • Robots.txt and robots meta
              TheEspresseo
              TheEspresseo
              0
              5
              1.1k

            • Robots.txt
              Tom-Anthony
              Tom-Anthony
              0
              4
              1.1k

            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