Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
400 views
in Plugins by

Hey Question2answers Community...

I want to No-index my website all category pages (site.com/category name) through robots.txt file. Can anyone suggest me how to write in robots.txt file.

Q2A version: 1.8.5

2 Answers

+2 votes
by

Simply put a list of Disallow entries with your category names in the robots file (beware that categories are also accessible under the path "/questions"):

User-agent: *
Disallow: /category-A
Disallow: /questions/category-A
Disallow: /category-B
Disallow: /questions/category-B
...
Sitemap: https://example.org/sitemap.xml

Note that if your robots file contains a sitemap URL (which it should) you need to remove the category entries from the sitemap as well. However, the Q2A default sitemap plugin only allows for omitting the category browser, not the individual category entries (https://example.org/questions/category-A, https://example.org/questions/category-B, ...). Hence you need to either remove the sitemap (not recommended), or use a different plugin for generating it without category entries.

There is at least one more advanced sitemap plugin available, but I don't know if it supports omitting categories, since I haven't used it myself. You may need to patch the code either way.

–2 votes
by

You can no-index in wordpress site by using rankmath plugin.

  1. install rankmath plugin first
  2. Go to  domain.com/wp-admin/admin.php?page=rank-math-options-titles
  3. go to category section
  4. activate meta archive
  5. tick no-index
As seen in a pictute below
rankmath to noindex a category
Hopefully this useful for you
...