Make WordPress Core


Ignore:
Timestamp:
02/16/2021 11:36:44 PM (4 years ago)
Author:
peterwilsoncc
Message:

General: Add noindex robots meta tag to search results.

Prevent search engines indexing internal search results to protect against reflected web spam attacks.

Props abagtcs, audrasjb, ayeshrajans, burtrw, johnbillion, jonoaldersonwp, peterwilsoncc, poena, sabernhardt, xkon.
Fixes #52457

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r50131 r50370  
    239239// Robots filters.
    240240add_filter( 'wp_robots', 'wp_robots_noindex' );
     241add_filter( 'wp_robots', 'wp_robots_noindex_search' );
    241242add_filter( 'wp_robots', 'wp_robots_max_image_preview_large' );
    242243
Note: See TracChangeset for help on using the changeset viewer.