undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. On-Page Optimization
  4. How to exclude URL filter searches in robots.txt

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

How to exclude URL filter searches in robots.txt

On-Page Optimization
4
9
12.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • neenor
    neenor last edited by Sep 4, 2013, 12:35 PM

    When I look through my MOZ reports I can see it's included 'pages' which it shouldn't have included i.e. adding filtering rules such as this one http://www.mydomain.com/brands?color=364&manufacturer=505

    How can I exclude all of these filters in the robots.txt? I think it'll be:

    Disallow: /*?color=$

    Is that the correct syntax with the $ sign in it? Thanks!

    1 Reply Last reply Reply Quote 0
    • Everett
      Everett @swissmadesmt last edited by Jun 20, 2017, 5:00 PM Jun 20, 2017, 5:00 PM

      Unless you're specifically calling out Bing or Baidu... in your Robots.txt file they should follow the same directives as Google so testing with Google's Robots.txt file tester should suffice for all of them.

      1 Reply Last reply Reply Quote 0
      • topic:timeago_earlier,7 days
      • swissmadesmt
        swissmadesmt last edited by Jun 13, 2017, 9:54 AM Jun 13, 2017, 9:54 AM

        Yes, but what about bing and rest of Search Engine?

        Everett 1 Reply Last reply Jun 20, 2017, 5:00 PM Reply Quote 0
        • topic:timeago_earlier,4 years
        • Everett
          Everett @neenor last edited by Sep 5, 2013, 1:59 PM Sep 5, 2013, 1:59 PM

          Adrian,

          I agree that there certainly is a right answer to the question posted, as the question asks specifically about one way to manage the issue, being a block of filters in the robots.txt file. What I was getting at is that this may or may not necessarily be the "best" way, and that I'd need to look at your site and your unique situation to figure our which would be the best solution for your needs.

          It is very likely that with these parameters a robots.txt file block is the best approach, assuming the parameters aren't added by default into category page or category pagination page navigational links, as then it would affect the bot's ability to crawl the site. Also, if people are linking to those URLs (highly unlikely though) you may consider a robots meta noindex,follow tag instead so the pagerank could flow to other pages.

          And I'm not entirely sure the code you provided above will work if the blocked parameter is the first one in the string (e.g. domain.com/category/?color=red) as there is the additional wildcard between the ? and the parameter. I would advise testing this in Google Webmaster Tools first.

          1. On the Webmaster Tools Home page, click the site you want.
          2. Under Crawl, click Blocked URLs.
          3. If it's not already selected, click the Test robots.txt tab.
          4. Copy the content of your robots.txt file, and paste it into the first box.
          5. In the URLs box, list the site to test against.
          6. In the User-agents list, select the user-agents you want (e.g. Googlebot)
          1 Reply Last reply Reply Quote 0
          • neenor
            neenor @Everett last edited by Sep 5, 2013, 1:31 PM Sep 5, 2013, 1:31 PM

            There certainly is a right answer to my question - I already posted it here earlier today:

            Disallow: /*?color=
             Disallow: /
            ?*manufacturer=

            Without the $ at the end which would otherwise denote the end of the URL.

            Everett 1 Reply Last reply Sep 5, 2013, 1:59 PM Reply Quote -1
            • Everett
              Everett last edited by Sep 5, 2013, 12:52 PM Sep 5, 2013, 12:52 PM

              Hello Adrian,

              The Moz reports are meant to help you uncover issues like this. If you're seeing non-canonical URLs in the Moz report then there is a potential issue for Google, Bing and other search engines as well.

              Google does respect wildcards (*) in the robots.txt file, though it can easily be done wrong. There is not right or wrong answer to the issue of using filters or faceted navigation, as each circumstance is going to be different. However, I hope some of these articles will help you identify the best approach for your needs:

              (Note: Faceted Navigation is not exactly the same as category filters, but the issues and possible solutions are very similar

              )Building Faceted Navigation That Doesn't Suck Faceted Navigation Whiteboard Friday
              Duplicate Content: Block, Redirect or Canonical
              Guide to eCommerce Facets, Filters and Categories
              Rel Canonical How To and Why Not
              Moz.com Guide to Duplicate Content

              I don't know how your store handles these (e.g. does it add the filter automatically, or only when a user selects a filter?) so I can't give you the answer, but I promise if you read those articles above you will have a very good understanding of all of the options so you can choose which is best for you. That might end up being as simple as blocking the filters in your robots.txt file, or you may opt for rel canonical, noindex meta tag, ajax, Google parameter handling, etc...

              Good luck!

              neenor 1 Reply Last reply Sep 5, 2013, 1:31 PM Reply Quote 0
              • neenor
                neenor @stever999 last edited by Sep 5, 2013, 7:13 AM Sep 5, 2013, 7:13 AM

                It's not Google's index that I'm interested in in this case, it's for the MOZ reports. Moz was including over 10,000 'pages' because it was indexing these URLs. Now I know how to edit the robots.txt Moz will be prevented from indexing them again (we only have around 2,000 real pages, not 10,000)

                1 Reply Last reply Reply Quote 0
                • neenor
                  neenor last edited by Sep 5, 2013, 7:11 AM Sep 5, 2013, 7:11 AM

                  I sought out the answer from a developer and got the following reply, so posting here in case it helps someone else:

                  To exclude pages with color or manufacture in them you can use

                  Disallow: /*?color=
                   Disallow: /
                  ?*manufacturer=

                  A  question mark in your try should be omitted as it denotes the end of the url

                  1 Reply Last reply Reply Quote 0
                  • stever999
                    stever999 last edited by Sep 4, 2013, 5:39 PM Sep 4, 2013, 5:39 PM

                    Hi

                    I would recommend excluding these in Google Webmaster Tools. Once logged in to your account under the "Crawl" menu you will find "URL Parameters". Find the relevant parameter in the list on this page and you can tell Google not to index these pages.

                    Hope this helps.

                    Steve

                    neenor 1 Reply Last reply Sep 5, 2013, 7:13 AM Reply Quote 0
                    • 1 / 1
                    1 out of 9
                    • First post
                      1/9
                      Last post

                    Got a burning SEO question?

                    Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                    Start my free trial


                    Browse Questions

                    Explore more categories

                    • Moz Tools

                      Chat with the community about the Moz tools.

                    • SEO Tactics

                      Discuss the SEO process with fellow marketers

                    • Community

                      Discuss industry events, jobs, and news!

                    • Digital Marketing

                      Chat about tactics outside of SEO

                    • Research & Trends

                      Dive into research and trends in the search industry.

                    • Support

                      Connect on product support and feature requests.

                    • See all categories

                    Related Questions

                    • williamhuynh

                      How to deal with filter pages - Shopify

                      Hi there, /collections/living-room-furniture/black
                      /collections/living-room-furniture/fabric Is that ok to make all the above filter pages canonicalised with their main category /collections/living-room-furniture Also, does it needs to be noindex, follow as well? Note - already removed the content from filter pages, updated meta tags as well. Please advice, thank you

                      On-Page Optimization | Oct 20, 2019, 9:48 PM | williamhuynh
                      1
                    • maghanlinchpinsales

                      City Name in URL structure

                      I have a client whose site was built when they only served one market, and they now have that city in the majority of their URLs. I'm suggesting we redo the URL structure to remove this location from the main URLs (think homepage, about, etc.) since they have now expanded to three markets. They are seeing a lot of great organic traffic in that original market but are struggling in the new ones they've added so I'm helping to optimize their site. How critical do you think that removing that location from the URL is? I know we would need to implement 301 redirects, but wanted to get thoughts on this.

                      On-Page Optimization | Mar 23, 2017, 1:35 PM | maghanlinchpinsales
                      0
                    • MeasureEverything

                      Should I use an acronym in my URL?

                      I know that Google understands various acronyms. Example: If I search for CRM System, it knows i'm searching for a customer relationship management system. However, will it recognize less known acronyms? I have a page geared specifically for SAP data archiving for human capital management systems. For those in the industry, they simply call it HCM. Here is how I view my options: Option #1: www.mywebsite.com/sap-data-archiving/human-capital-management Option #2: www.mywebsite.com/sap-data-archiving/hcm Option #3: www.mywebsite.com/sap-data-archiving/hcm-human-capital-management With option #3, i'm capturing the acronym AND the full phrase. This doesn't make my URL overly long either. Of course, in my content i'll reference both. What does everyone else think about the URL? -Alex

                      On-Page Optimization | Jul 2, 2015, 11:27 AM | MeasureEverything
                      0
                    • StoryScout

                      Is using hyphens in a URL to separate words good practice?

                      Hi guys, I have a client who wants to use a hyphen to separate two words in the URL to make each work stand out. Is is good or bad practice to use a hyphen in a URL and will it affect rankings? Thanks!

                      On-Page Optimization | Mar 3, 2015, 12:34 AM | StoryScout
                      0
                    • JohnHuynh

                      Solve duplicate content issues by using robots.txt

                      Hi, I have a primary website and beside that I also have some secondary websites with have same contents with primary website. This lead to duplicate content errors. Because of having many URL duplicate contents, so I want to use the robots.txt file to prevent google index the secondary websites to fix the duplicate content issue. Is it ok? Thank for any help!

                      On-Page Optimization | Jul 16, 2013, 11:02 PM | JohnHuynh
                      0
                    • dealblogger

                      How do I remove a Canonical URL Tag?

                      Some of my report cards say I have too many canonical URL tags. However, there is no information no how to delete one. Can someone give me a link or explain? Thanks.

                      On-Page Optimization | Apr 29, 2013, 5:42 PM | dealblogger
                      0
                    • Kotkov

                      Right way to block google robots from ppc landing pages

                      What is the right way to completely block seo robots from my adword landing pages? Robots.txt does not work really good for that, as far I know. Adding metatags noindex nofollow on the other side will block adwords robot as well. right? Thank you very much, Serge

                      On-Page Optimization | Mar 2, 2012, 8:58 PM | Kotkov
                      0
                    • JesseCWalker

                      How long is too long for domain URL length?

                      I noticed one of the negatively correlated ranking factors was length of URL.  I'm building a page from scratch, we are trying to rank for 'Minneapolis Fitness' and 'Minneapolis Massage'. Is www.minnnepolismassageandfitness.com  just ridiculously long?  Or does the exact match outweigh the penalty for URL length?

                      On-Page Optimization | Sep 8, 2011, 12:35 PM | JesseCWalker
                      2

                    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
                    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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy

                    Looks like your connection to Moz was lost, please wait while we try to reconnect.