Making WordPress.org

Changeset 7787


Ignore:
Timestamp:
10/27/2018 05:27:41 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: Prevent search results from being indexed.

Props jonoaldersonwp.
Fixes #3850.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r7633 r7787  
    292292    }
    293293
     294    // Prevent duplicate search engine results.
     295    if ( get_query_var( 'plugin_advanced' ) || is_search() ) {
     296        echo '<meta name="robots" content="noindex, follow" />' . "\n";
     297    }
     298
    294299    if ( ! is_singular( 'plugin' ) ) {
    295300        return;
     
    319324        printf( '<meta name="thumbnail" content="%s" />' . "\n", esc_url( $icon['icon_2x'] ?: $icon['icon'] ) );
    320325    }
    321 
    322     // Prevent duplicate search engine results.
    323     if ( get_query_var( 'plugin_advanced' ) ) {
    324         echo '<meta name="robots" content="noindex, follow" />' . "\n";
    325     }
    326326}
    327327add_action( 'wp_head', __NAMESPACE__ . '\social_meta_data' );
Note: See TracChangeset for help on using the changeset viewer.