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 do i block an entire category/directory with robots.txt?
- 
					
					
					
					
 Anyone has any idea how to block an entire product category, including all the products in that category using the robots.txt file? I'm using woocommerce in wordpress and i'd like to prevent bots from crawling every single one of products urls for now. The confusing part right now is that i have several different url structures linking to every single one of my products for example www.mystore.com/all-products, www.mystore.com/product-category, etc etc. I'm not really sure how i'd type it into the robots.txt file, or where to place the file. any help would be appreciated thanks 
- 
					
					
					
					
 Thanks for the detailed answer, i will give it a try! 
- 
					
					
					
					
 Hi This should do it, you place the robots.txt in the root directory of your site. User-agent: * Disallow: /product-category/ You can check out some more examples here: http://www.seomoz.org/learn-seo/robotstxt As for the multiple urls linking to the same pages, you will just need to check all possible variants and make sure you have them covered in the robots.txt file. Google webmaster tools has a page where you can use to check if the robots.txt file is doing what you expect it to do (under Health -> Blocked Urls). It might be easier to block the pages with a meta tag as described in the link above if you are running a plugin allowing this, that should take care of all the different url structures also. Hope that helps! 
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 ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		Using h2 for category on ecommerce website
 Hi, I am working on an ecommerce site and the main category - lets call them car widgets - is using a h1 at the top of the page which is great. There are 4 sub categories on the page - lets call one of them red widget. The only content on the page is the sub category name and an image. Should the sub category red widget use a h2? Thanks S On-Page Optimization | | bedynamic0
- 
		
		
		
		
		
		Updating Old Content at Scale - Any Danger from a Google Penalty/Spam Perspective?
 We've read a lot about the power of updating old content (making it more relevant for today, finding other ways to add value to it) and republishing (Here I mean changing the publish date from the original publish date to today's date - not publishing on other sites). I'm wondering if there is any danger of doing this at scale (designating a few months out of the year where we don't publish brand-new content but instead focus on taking our old blog posts, updating them, and changing the publish date - ~15 posts/month). We have a huge archive of old posts we believe we can add value to and publish anew to benefit our community/organic traffic visitors. It seems like we could add a lot of value to readers by doing this, but I'm a little worried this might somehow be seen by Google as manipulative/spammy/something that could otherwise get us in trouble. Does anyone have experience doing this or have thoughts on whether this might somehow be dangerous to do? Thanks Moz community! On-Page Optimization | | paulz9990
- 
		
		
		
		
		
		Will it upset Google if I aggregate product page reviews up into a product category page?
 We have reviews on our product pages and we are considering averaging those reviews out and putting them on specific category pages in order for the average product ratings to be displayed in search results. Each averaged category review would be only for the products within it's category, and all reviews are from users of the site, no 3rd party reviews. For example, averaging the reviews from all of our boxes products pages, and listing that average review on the boxes category page. My question is, will this be doing anything wrong in the eyes of Google, and if so how so? -Derick On-Page Optimization | | Deluxe0
- 
		
		
		
		
		
		Content hidden behind a 'read all/more..' etc etc button
 Hi Anyone know latest thinking re 'hidden content' such as body copy behind a 'read more' type button/link in light of John Muellers comments toward end of last year (that they discount hidden copy etc) & follow up posts on Search Engine Round Table & Moz etc etc ? Lots of people were testing it and finding such content was still being crawled & indexed so presumed not a big deal after all but if Google said they discount it surely we now want to reveal/unhide such body copy if it contains text important to the pages seo efforts. Do you think it could be the case that G is still crawling & indexing such content BUT any contribution that copy may have had to the pages seo efforts is now lost if hidden. So to get its contribution to SEO back one needs to reveal it, have fully displayed ? OR no need to worry and can keep such copy behind a 'read more' button/link ? All Best Dan On-Page Optimization | | Dan-Lawrence0
- 
		
		
		
		
		
		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 | | JohnHuynh0
- 
		
		
		
		
		
		How often should I update category and product content to keep it fresh?
 I want to keep our site up to date and fresh with content. How often should I update categories and products pages with content? What angel should I take with categories (new products/services etc.) Thanks Craig On-Page Optimization | | Towelsrus0
- 
		
		
		
		
		
		Ecommerce - how many clicks from the home page should categories be
 My client has about 300 products in 20 categories with a lot of overlap. How many clicks from the home page should we keep the products? We're not doing pagination. I'd been told several years ago that all products should be 2 clicks or less from the home page. Is this true today? Thanks. On-Page Optimization | | BobGW1
- 
		
		
		
		
		
		Blog.mysite.com or mysite.com/blog?
 Hi, I'm just curious what the majority think of what's the best way to start a blog on your website for SEO benefits. Is it better to have it under a sub domain or a directory? Or does it even matter? On-Page Optimization | | truckguy770
 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				