WordPress.org

Making WordPress.org

Changeset 9471


Ignore:
Timestamp:
02/05/2020 05:53:53 AM (6 months ago)
Author:
dd32
Message:

Theme Directory: Output a noindex robots tag for themes marked as potentially outdated.

Fixes #4994.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r9188 r9471  
    10831083        echo "<meta name='twitter:site' content='@WordPress'>\n";
    10841084        echo "<meta name='twitter:image' content='" . esc_attr( $theme->screenshot_url . '?w=560&amp;strip=all' ) . "' />\n";
     1085    }
     1086
     1087    // If it's outdated, noindex the theme.
     1088    if ( time() - strtotime( $theme->last_updated ) > 2 * YEAR_IN_SECONDS ) {
     1089        echo "<meta name='robots' content='noindex,follow' />\n";
    10851090    }
    10861091}
Note: See TracChangeset for help on using the changeset viewer.