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. Best practice for disallowing URLS with Robots.txt

    Best practice for disallowing URLS with Robots.txt

    Intermediate & Advanced SEO
    3 3 650
    • 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.
    • centurysafety
      centurysafety last edited by

      Hi Everybody,

      We are currently trying to tidy up the crawling errors which are appearing when we crawl the site. On first viewing, we were very worried to say the least:17000+. But after looking closer at the report, we found the majority of these errors were being caused by bad URLs featuring:

      • Currency -  For example: "directory/currency/switch/currency/GBP/uenc/aHR0cDovL2NlbnR1cnlzYWZldHkuY29tL3dvcmt3ZWFyP3ByaWNlPTUwLSZzdGFuZGFyZHM9NzEx/"
      • Color -  For example: ?color=91
      • Price - For example: "?price=650-700"
      • Order - For example: ?dir=desc&order=most_popular
      • Page - For example: "?p=1&standards=704"
      • Login - For example: "customer/account/login/referer/aHR0cDovL2NlbnR1cnlzYWZldHkuY29tL2NhdGFsb2cvcHJvZHVjdC92aWV3L2lkLzQ1ODczLyNyZXZpZXctZm9ybQ,,/"

      My question now is as a novice of working with Robots.txt, what would be the best practice for disallowing URLs featuring these from being crawled?

      Any advice would be appreciated!

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

        First I assume you have webmaster tools set up?

        They have a robots.txt tester tool which you can test out different parameters to make sure you get the right syntax. For example color would be blocked by: Disallow: /?color=91* and you would follow that similar format more or less.

        If you are confused I highly recommend reading through Moz's robots.txt best practices guide before you make any changes. Be sure to test all out in webmaster tools(search console)>robots.txt tester.

        Let me know if you run into any problems.

        1 Reply Last reply Reply Quote 1
        • TimHolmes
          TimHolmes last edited by

          If you are looking to disallow url parameters you could use something like the following as a convention.

          Disallow: /?  or Disallow: /?dir=&order=&p= if you wanted to be more accurate with specific parameters. There have been a few Moz questions of this type over the last few years, if you do look to remove the parameters.

          Also try and ensure that the product pages you have listed are well canonicalised and point to the original product etc. A good review on how to do this can be found here. This will in most cases be enough to remove any indexation/duplicate issues.

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • Mass URL changes and redirecting those old URLS to the new. What is SEO Risk and best practices?
            Charles-O
            Charles-O
            0
            6
            465

          • Faceted Navigation URLs Best Practices
            Joe_Stoffel
            Joe_Stoffel
            0
            4
            571

          • Will disallowing URL's in the robots.txt file stop those URL's being indexed by Google
            Martijn_Scheijbeler
            Martijn_Scheijbeler
            0
            11
            1.6k

          • URL Rewriting Best Practices
            TheDude
            TheDude
            0
            12
            2.9k

          • Robots.txt Blocking - Best Practices
            ReunionMarketing
            ReunionMarketing
            0
            7
            456

          • Image URLs - best practice
            Dr-Pete
            Dr-Pete
            1
            3
            1.2k

          • Robots.txt - blocking JavaScript and CSS, best practice for Magento
            Andy.Drinkwater
            Andy.Drinkwater
            0
            3
            2.0k

          • Blocking Dynamic URLs with Robots.txt
            TaitLarson
            TaitLarson
            1
            4
            5.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