Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to add noindex on certain category

edited February 2017 in Vanilla 2.0 - 2.8

How to add meta noindex on certain vanilla category?
Is there any addon to make it easier adding meta noindex on one or more vanilla category?


  • pioc34pioc34 Pézenas ✭✭

    Hi, do you find a way to do that? I want to noindex an entire category too

  • R_JR_J Ex-Fanboy Munich Admin

    You would need a small plugin for that. It should also be possible with a custom theme, but I think something like that belongs to a plugin and not a theme...

       public function base_render_before($sender, $args) {
           if (!property_exists($sender, 'CategoryID')) {
           if (!in_array($sender->CategoryID, [1,3,5])) {
                   'name' => 'robots',
                   'content' => 'noindex, follow'

    This method needs to be inside of your plugin class. It checks if the current page belongs to one and only one category (like a discussion would) and afterwards checks if this category is in a list. You would have to customize that list or replace it with a direct comparison "$sender->CategoryID != 7"

    The last piece of code adds the noindex meta tag.

  • pioc34pioc34 Pézenas ✭✭

    Cool @R_J

    i will make my own plugin!

  • R_JR_J Ex-Fanboy Munich Admin

    You can pimp it up, by making the list of CategoryIDs configurable and upload it 👍️

  • pioc34pioc34 Pézenas ✭✭

    I will try it

  • Or you can duplicate/edit your theme template

      {if $Category.Name == 'this' || $Category.Name == 'that'}
Sign In or Register to comment.