How to add noindex to an entire category?

AI-generated summary

The discussion revolves around how to add “noindex” to an entire category in Discourse. pacoesni wants to prevent a specific category and its posts from being indexed by search bots, while still allowing users to access them. pfaffman initially suggests changing the permissions to require login, but then understands that pacoesni only wants to hide the category from search bots.

rking explains that there is no built-in facility to add “noindex” to posts in a category and suggests creating a plugin to add the meta directive to the crawler layout. pfaffman offers to make a plugin available if pacoesni has a budget or if he finds the time.

The discussion further reveals that pacoesni is trying to connect WordPress with Discourse using a plugin and wants to prevent duplicate entries from being indexed by Google. Mittineague suggests that adding the category to robots.txt may not be effective and recommends either making the category non-public or not worrying about which entry Google chooses to return in the results.

Hi guys, I just open a new discourse community…of course we wanna be index on Google and it’s friends, but we’re gonna open a category that we don’t want to show with any search bot. So the simple question is How to add “nofollow” to an entire category?

Cheers.

Change the permissions to require being logged in.

Not so bad. But what if I just want to hide it from the search bots?

Links already have nofollow added to them. If staff users want to post nofollow links, you can make an <a> tag instead of the other methods of making links.

Oh. I totally missed the question. I thought he wanted the category not to be indexed.

Right. All links have nofollow for TL2 and below.

Right. I just want an entire category and all its posts not to be indexed. I don’t care about the links. I’m talking about the post.

Ah. I don’t think there is a facility to add noindex to posts in a category, and you certainly couldn’t add it to parts of the topic list without tanking the ranking of your entire site.

You’d have to write a plug-in that adds the meta directive to the crawler layout, I don’t think there’s much hope for adding it with JavaScript.

If you want the posts to be publicly available, but denied in robots.txt, you need a plugin. I sort of wrote one. If you’ve got a budget or I find the time, I’ll make it available.

Two problems with that: Noindex breaks if you deny the page in robots.txt (can’t load the page to see the noindex), and that would make the list extremely large.

He wants the posts in the category not to be indexed, so denying the category is, I think, what he means.

Exactly. The things is that I’m trying to connect WP with Discourse with the plugin and manage the comments of my blog posts with Discourse. But I don’t want Google indexing the entry on Discourse because it would be a duplicate of the Wordpress entry, thinking on SEO of course. So I think the proper way to do this is creating a Category, like ‘Feedback’, on Discourse and adding a nofollow by default to all entries on it.

Oh. That. See https://experts.feverbee.com/t/is-it-possible-for-the-feverbee-blog-posts-to-be-pulled-in-full/6192/7 .

I see. I’m not an SEO person. I think that adding the no follow for the category to robots.txt will do what you want.

I think the effectiveness depends on whether or not any links get exposed

… the page can still appear in search results, for example if other pages link to it.

I think your best options are to either put those posts in a non-public category (no “everyone” permissions) or to not worry about which one Google chooses to return in the results.