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 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
-
Does DA/PA have any effect on rankings?
I have seen many people are concerned about increasing DA and PA of their websites. While I am very curious why do people focus on increasing DA and PA? Does DA and PA effect the rankings of the website? Because I have recently launched my website regarding men beard trimmer and it is ranking on 1st page but not on number 1 position. Will increasing DA/PA of the site help me in occupying 1st position?
On-Page Optimization | | RyanAmin0 -
Alt text / internal linking
Hi everyone A question about best practice when linking from pictures on our homepage - hirespace.com We have an option of using divs with background images (nicer in terms of design) but it means that we can't use anchor text or alt text to show Google what these internal links are about. The other option is to use images which do not allow us as much flexibility in terms of CSS but would allow us to use alt text. There is also an opinion that we should have separate text links at the bottom of the homepage to get the anchor page in. What is best practice in this situation - is alt text worth sacrificing some CSS flexibility for? How important is anchor/alt text for internal linking? Thanks guys.
On-Page Optimization | | HireSpace0 -
Best practice for footer in ecommerce - Shall I add Top Category links?
What would you recommend regarding links to "Top Products" and "Top Categories" in footer? Would you add them to give extra link juice to top categories? would you try to avoid category links in footer that are already in the header navigationor in the main content area to avoid linking twice from all pages? would you vary these top category links in footer according to main category
On-Page Optimization | | lcourse0 -
Do Parent Categories Hurt SEO?
I have parent categories and subcategories. Will it be harder for the subcategories to rank well because they have a parent category? The URL is longer, for one. I am just wondering if I should not have parent categories. I have one category page doing really well and I am trying to boost the others (most of which are subcategories) and this is a concern for me. Thanks! Edit: I also have a category that has 2 parent categories. I want it automatically in those 2 categories and one of its own. By itself it is very important keyword. Is this ok or should I have it be a parent category?
On-Page Optimization | | 2bloggers0 -
Ecommerce On-Site SEO: Keywords in Category Descriptions
Hello, I'm doing on-site SEO for a client's ecommerce site. Are 160 words enough for a category description? I'm using the keywords once at the top of the description, and once at the bottom of the description, with the ones at the bottom reworded so that they are the keywords with a different word order. I used to put the keywords in 3 times but it just feels like stuffing. Is twice, worded differently the second time, enough for a category description? Thanks.
On-Page Optimization | | BobGW0 -
Http://www.xxxx.com does not re-direct to http://xxx.com
When typing in my website URL www.earthsaverequipment.com successfully re-directs to earthsaverequipment.com as specified in robot. However if you type http://www.earthsaverequipment.com it brings up a 404 error Is this a potential issue? if so is there a way to fix it? thanks
On-Page Optimization | | Earthsaver0 -
Same H1 tag in header across entire site
Should I have the same H1 tag in my header through out my entire site? Or is this considered to be self canalization for my main keywords. For example right now I have an H1 tag with my main targeted keywords on every page on my site, even if the pages content doesn't necessarily match the keywords in the H1 tag.
On-Page Optimization | | TRICORSystems0 -
Google Page Rank of my site has dropped from 4/10 to 3/10
Google Page rank of my website has been dropped after Panda Update. Can anyone help me out to tell me the possible reasons about the same. We have tried to make our website more lively and user friendly. We have indulged some graphics to make it more attractive. But it seems it backfired us. my site is http://www.myrealdata.com as well as Google page ranking of my Quickbooks hosting page has been dropped as well. It would be great if someone can help me out with expert suggestions.
On-Page Optimization | | SangeetaC1