Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add noindex to some forum pages?


  • van24
    Participant

    @van24

    We’ve been told that our forum may be causing an issue with Google’s thin content algorithm, so I’m looking to find a way to noised some of the pages with little content.

    I’ve already managed to noindex all the views, replies, users, and topics with replies (see the code below, if anyone’s interested).

    I would also like to noindex any forum topic that has total content of less than X words/characters. Is there any way to do that in functions.php? Thanks in advance!

    Here’s what I have so far:

    add_action( 'wp_head', 'topic_add_noindex' );
    function topic_add_noindex()
    {
      if (bbp_is_single_user())
      {
        wp_no_robots();
      }	
      if ( bbp_is_single_topic() && bbp_get_topic_reply_count()==0)
      {
        wp_no_robots();
      }
      if (bbp_is_single_view())
      {
        wp_no_robots();
      }	
      if (bbp_is_single_reply())
      {
        wp_no_robots();
      }	
    }
  • You must be logged in to reply to this topic.
Skip to toolbar