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
-
Product URL
Hey Mozzers, Nice quick and simple one for you. Which of these 2 options is better for SEO and userbility and why domain.co.uk/productname.html
On-Page Optimization | | ATP
domain.co.uk/shop/category/product.html The top one stops stops any funky problems with magento making 2 paths to the same product but the second option feels more natural and helpful to the user. I feel both a valid but I would like some opinions please0 -
Meta Robots index & noindex Both Implemented on Website
I don't want few of the pages of website to get indexed by Google, thus I have implemented meta robots noindex code on those specific pages. Due to some complications I am not able to remove meta robots index from header of every page Now, on specific pages I have both codes 'index & noindex' implemented. Question is: Will Google crawl/index pages which have noindex code along with index code? Thanks!
On-Page Optimization | | Exa0 -
Using Transcription Service For Videos - Have Question Around Search and Spiders
Hi All, So I have put together a weekly video series on security topics. I have read an SEOmoz post around how you can boost SEO by adding the transcription to the page, which makes perfectly good sense. My question is, can I include the first couple of paragraphs and then have a "read the full transcription" so when the user clicks, the rest of the content appears? Do the search engine spiders only crawl the first two paragraphs in this instance or do they crawl the whole thing even though the entire content is not on the page? I dont mind making the page longer and including the entire transcription if it is easier for SEO but if there is no difference, than I think the first option would be the best user experience. Thanks for the help Pat
On-Page Optimization | | PatBausemer0 -
Title and Url Agreement
In the case of trying to hit a wide taxonomy, is it better to keep your title and URL in agreement, or to vary them slightly for exact search matching. For instance this blog post which has the following url: http://www.simplifiedbuilding.com/blog/build-your-own-standing-desk/ has the title "Make a Stand Up Desk - Better Working, Longer Living" The ideas is that build and make are similar words and "stand up" and "standing" are also similar. So what is the better way to go?
On-Page Optimization | | CPollock0 -
Tag-URLs in Magento
Hello, I have got a problem concerning Tag-URLs in Magento (the URLs mentioned are just fictitious 😞 At the moment, they look something like this: (1) http://store.com/tag/product/list/tagId/1/ ... so these URLs are not search engine friendly at all. Using a Magento extension you could transform them in speaking URLs: (2) http://store.com/tag/digital-cameras What would you do if you sold, say, digital cameras and your online shop ranked high for the keyword "digital camera" with URL No. 1 (not search engine friendly). Would you transform (1) in (2) and 301 all non speaking URLs? But would you keep the high ranking for "digital camera" when 301 to URL No. (2). But, what I'm most concerned of is : There is actually a landing page (category page) for the keyword "digital camera" : http://store.com/digital-cameras. Shouldn't the last URL rank high for "digital camera"? (instead of the tag URLs). But given the situation above, does it make sense now to 301 the tag URL to the category page? I would perhaps lose my good ranking, wouldn't I? Thanks a lot for your help! Martin
On-Page Optimization | | SmartyMarty810 -
Page URL Hiearchy
So I have read on here that page URL Hiearchy is important. My question is from a search engine standpoint which of the following methods would be the best to use (or another if not listed) COMPACT and naturally hierarchical MountainBiking.com MountainBiking.com/adventures ( a list of the pages below ) MountainBiking.com/adventures/in whistler (for each page) MountainBiking.com/adventures/in utah OR VERBOSE but reptetive MountainBiking.com MountainBiking.com/Mountain Biking adventures ( intro + a list of the pages below ) MountainBiking.com/Mountain Biking Adventures/Mounting Biking adventures in whistler MountainBiking.com/Mountain Biking Adventures/Mountain Biking Adventures in Utah It seemed like the blog I read suggested the compact form, but it seems to me that the verbose (though admittedly a bit clunky) seems better so far as exact keyword match etc. Experience and or advice on this?
On-Page Optimization | | bThere0 -
How to Define Best URL Structure for Product Pages?
I am working on my website to edit structure with help of Google's search engine optimization starter guide. There is really good instruction to define URL structure which help us to perform well over Google's organic search. I have resolved issues regarding category pages but, I have confusion to define best URL structure for product pages. My website's product page URL structure is as follow. http://www.vistastores.com/marketumbrellas-californiaumbrella-slpt758-f13-red.html http://www.vistastores.com/homefurniture-winsomewood-93630.html URL structure is constructed with following terms. 1. Root Category Name (Market Umbrellas or Home Furniture or ....) 2. Brand Name 3. Manufacturer Part Number I am not happy with this structure and also not performing well over Google's organic search. I am thinking to include product name or title tag in URL after root domain. But, it may create very long URL and create issues in organic search display. Does it really matter to perform well over Google's organic search? How can I define best URL structure for product pages?
On-Page Optimization | | CommercePundit0 -
The SEOmoz crawler is being blocked by robots.txt need help
SEO moz is showing me that the robot.txt is blocking content on my site
On-Page Optimization | | CGR-Creative0