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 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
-
I analysis my domain (http://yourdigibuddy.com/) on moz domain analysis. But there is not data show and show message "No data here". What should I do?
_ I analysis my domain (http://yourdigibuddy.com/) on Moz domain analysis. But there is not data show and show the message "No data here". What should I do?_
On-Page Optimization | | MelissaDooley0 -
How do you find domains with good PA/DA?
I am looking for a domain with a good PA/DA but I cant find a list of relevant domains that are decent. Does anyone know any website that can be used to make the search a bit easier?
On-Page Optimization | | trobs24680 -
Internal Linking : File Name or URI/filename.html
Hi, For crawlability, what would be the best way to do internal linking. /aboutus.html or www.xyz.com/aboutus.com Would this make any difference to the website in terms of SEO or bot crawling the website? Regards, Sree
On-Page Optimization | | jungleegames0 -
Word count and ranking/traffic
Hello All, Recently, a client of ours enlisted another firm to redesign their website, www.thepodhotel.com. The new site went live on February 20th. Since that date, we have seen a 30% drop in Google Organic traffic, year-over-year. Even a cursory glance at the site will tell you that there was quite a bit left on the table, from an SEO point of view. However, my question pertains to word count. The word count on the new site is quite a bit lower than the old site. How much value do you feel this has on rankings? Do you feel that, among the many other items that need to be addressed, we should be focusing on creating more copy? I appreciate all of your input. Frank
On-Page Optimization | | FrankSweeney0 -
Duplicate Content from WordPress Category Base?
I recently changed my category base in WordPress and instead of redirecting or deleting the old base, WordPress kept the content up. So I now have duplicate content on two different urls - one on the old category base, one on the new category base. How should I handle this situation? The site is only a couple weeks old, if that makes any difference.
On-Page Optimization | | JABacchetta0 -
How to make FB comments crawlable by Google? <noscript>?</noscript>
We get tons of FB comments, but it's all in iframe, so Google doesn't give us any credit for it. We found a solution - turn all the comments into HTML and hide it from readers with <noscript>. </p> <p> </p> <p>Will this help? I heard that Google considers <noscript> a scammy practice. Is that true?</p> <p>How do you guys make your FB comments SEO friendly?</p> <p> </p></noscript>
On-Page Optimization | | Alexey_mindvalley0 -
Wordpress: Should I NO INDEX Categories & Archives Pages?
I am new to SEOmoz & trying to work my way through the ca-trillion errors that have been found on my site, but for each one I want to ensure that I am helping rather than harming my site. The tool has (as a "notice") said that my category pages & Archives are NO-INDEX, is this how these pages should be dealt with? In addition, the crawler has also (as a "warning error) discovered that my categories, and Archives do not have a meta description..is this of great importance for non indexed pages of this type? Thanks so much to the SEOmoz forum members, you have so far been of invaluable help to me.
On-Page Optimization | | KMack2 -
Impact of removing category sidebar with keywords?
Our site (a niche financial publication: insideARM.com) requires some more room in the sidebar. We're considering removing the categories (we call them topics) sidebar block, or cutting down the number of items displayed within it. My concern is that we'd be removing a direct link to landing pages for important keyword terms from our most powerful page (the index). Sure, we have the terms listed in the footer, but I am worried that the position change will lower the value of the links. Our users don't really use these links for navigational purposes, which is why it comes up as a potential removed item. Am I wrong to worry about this? Would we be crippling our category pages by doing this?
On-Page Optimization | | insideARM0