Making WordPress.org

Changeset 9454


Ignore:
Timestamp:
02/03/2020 09:57:12 PM (7 years ago)
Author:
coffee2code
Message:

Jobs theme: Noindex search results.

Props jonoaldersonwp, coffee2code.
Fixes #5002.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/functions.php

    r9406 r9454  
    130130
    131131/**
     132 * Outputs `noindex,follow` robots tag for search results.
     133 */
     134function jobswp_noindex_for_search() {
     135        if ( is_search() ) {
     136                wp_no_robots();
     137        }
     138}
     139add_action( 'wp_head', 'jobswp_noindex_for_search', 9 );
     140
     141/**
    132142 * Implement the Custom Header feature.
    133143 */
Note: See TracChangeset for help on using the changeset viewer.