How to exclude URL filter searches in robots.txt
-
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!
-
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.
-
Yes, but what about bing and rest of Search Engine?
-
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.
- On the Webmaster Tools Home page, click the site you want.
- Under Crawl, click Blocked URLs.
- If it's not already selected, click the Test robots.txt tab.
- Copy the content of your robots.txt file, and paste it into the first box.
- In the URLs box, list the site to test against.
- In the User-agents list, select the user-agents you want (e.g. Googlebot)
-
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.
-
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 ContentI 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!
-
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)
-
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
-
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
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
Solved Recommended title length for Google search results
I read the recommended title length is 50-60 characters depending on alphabets, etc,.
On-Page Optimization | | Mike555
Anyways, my question is, is there any harm of having longer title?
If all my important keywords are within the 50-60 characters that will show up on search results, I can still make the title longer, it's just that those keywords outside won't have any effect on search results?0 -
Search results meta error?
Hello I am new here. When I search my brand name "amazingbeautyhair" in google it shows like this,I have meta description,why it shows like this?how to fix please? sdWx6
On-Page Optimization | | yitong0 -
Google search: 'define:____'
See: http://screencast.com/t/oFSzIt5rRm Thrilled that Google is pulling our content over wikipedia (in this instance). Wondering how we can assure more success like this. Mike Corso
On-Page Optimization | | Mike_c
Gartner.com1 -
Articles URL
Hello, Currently, I am parsing article base on article ID on URL request. For example:
On-Page Optimization | | JohnHuynh
To go to the content of article **What is the visa on arrival? How to get it? **I am using URL like that http://www.vietnamvisacorp.com/news/what-is-the-visa-on-arrival--how-to-get-it--245.html and base on ID 245 to get this page content.
But, now I want to optimize this URL to http://www.vietnamvisacorp.com/news/what-is-the-visa-on-arrival--how-to-get-it.html. Then I got a problem: How to get an article without ID? Thanks,0 -
Should ".html" in the URL or not?
Does URL like /wedding-dresses.html/f/price/2,100 with "html" in the middle do harm to SEO? Should I drop the ".html"?
On-Page Optimization | | StevenRoland0 -
How to deal with tracking numbers in URLs
I am working on a site at the minute that has links like this: Jobs in London URL looks like: domain.com/jobs-in-london/ However, my developers insist that they need to use tracking codes, so everytime someone clicks on the above link, they are redirected (301) to a new URL that looks like: domain.com/search/1234567(unique search id) This is killing me when I am trying to get internal pages, like /jobs-in-london/ ranked. What to do?
On-Page Optimization | | MirandaP0 -
301 redirects / clean urls (2)
hello again! 1st i want to thank robert, istvan and everyone else for the great answers to my last question. i guess i should have been a bit more specific with the questionas i am still a bit unclear about a couple of things. i forgot to mention that we actually moved the site several months back and redirected all the "category" pages, but, i wasnt aware that the "product" pages were never redirecte! so my next questions are: at this point is it even worth redirecting those old product pages? if so, should we use the IP address as shown below or the domain as shown below ...i am guessing at the IP address. http://72.3.181.97/catalog/CanineCushionDogCouchBeds.aspx
On-Page Optimization | | k9byron
http://www.k9electronics.com/catalog/CanineCushionDogCouchBeds.aspx also, our old site was never deleted from the server. our ranking / sales dropped off by about 50% when the new site went live so im guessing this can be directly contributed to the products not being redirected / duplicate content from the 2 sites? im also guessing i need to find a new developer ..can i get a vote on that? 😉 <colgroup><col width="856"></colgroup>
| http://72.3.181.97/catalog/CanineCushionDogCouchBeds.aspx |0 -
What's the best practice for implementing a "content disclaimer" that doesn't block search robots?
Our client needs a content disclaimer on their site. This is a simple "If you agree to these rules then click YES if not click NO" and you're pushed back to the home page. I have this gut feeling that this may cause an upset with the search robots. Any advice? R/ John
On-Page Optimization | | TheNorthernOffice790