1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can you set pages within a forum to no-index

Discussion in 'XenForo Questions and Support' started by cmeinck, Aug 4, 2014.

  1. cmeinck

    cmeinck Well-Known Member

    I'm aware of edits to make set meta on threads to no-index. This works well. Is it possible to do something similar for pages within a specific forum category node? For example, set pages within an Off Topic node to no-index. I could add to robots.txt, but that wouldn't remove existing pages that are indexed. Considering the individual threads are not indexed, it makes sense to do the same for the pages of threads.

    Thanks!
     
  2. Walter

    Walter Well-Known Member

    I'm not sure if I understood you right, but if you want to add a

    <meta name="robots" content="noindex, follow" />

    to a certain forum node (in addition to the thread itself) you can achieve this by editing the forum_view template and add
    PHP:
    <xen:if is="in_array({$forum.node_id}, array(1,2,3,4))">
      <
    xen:container var="$head.robots">
      <
    meta name="robots" content="noindex, follow" />
      </
    xen:container>
    Replace 1,2,3,4 with the ids of the forums where you want the noindex.
     
    Kintaro, Claudio, TW89 and 1 other person like this.
  3. cmeinck

    cmeinck Well-Known Member

    Brilliant! Worked perfectly. Thanks so much!
     
  4. Walter

    Walter Well-Known Member

    You mean, you liked it? ;)
     
  5. Kintaro

    Kintaro Well-Known Member

    @Walter thank you

    p.s. in your code miss:
    Code:
    </xen:if>
     

Share This Page