WordPress.org

Making WordPress.org

Changeset 8044


Ignore:
Timestamp:
01/08/2019 06:21:37 AM (9 months ago)
Author:
dd32
Message:

Support Forums: Tweak the robots tag to noindex,follow for old (>1 year) topics, and add it to closed topics (>6 months) without replies.

Fixes #4025, #4027.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-archive/wporg-bbp-topic-archive.php

    r3667 r8044  
    22/**
    33 * Plugin Name: bbPress: Topic Archive
    4  * Description: Add noindex,nofollow to old topics.
     4 * Description: Add noindex,follow to old topics and closed topics without responses.
    55 * Version:     1.0
    66 * Author:      WordPress.org
     
    4242            bbp_is_topic( $post->ID )
    4343        &&
    44             ( time() - get_post_time( 'U', true, $post ) > YEAR_IN_SECONDS )
     44            (
     45                // Thread last modified is over a year old
     46                ( time() - get_post_time( 'U', true, $post ) > YEAR_IN_SECONDS )
     47            ||
     48                // Closed thread with no replies
     49                ( bbp_is_topic_closed( $post->ID ) && ! bbp_get_topic_reply_count( $post->ID, true ) )
     50            )
    4551        ) {
    46             echo '<meta name="robots" content="noindex,nofollow" />' . "\n";
     52            echo '<meta name="robots" content="noindex,follow" />' . "\n";
    4753        }
    4854    }
Note: See TracChangeset for help on using the changeset viewer.