Skip to content

Instantly share code, notes, and snippets.

@jjmontalban
Created January 18, 2023 12:06
Show Gist options
  • Save jjmontalban/d8458f76b413254cda69f75e8b6c4972 to your computer and use it in GitHub Desktop.
Save jjmontalban/d8458f76b413254cda69f75e8b6c4972 to your computer and use it in GitHub Desktop.
Poena ano index las paginas con 404
/**
* @snippet Poner a noindex las paginas con 404
* @author JJMontalban
*/
function add_noindex_nofollow_404() {
if ( is_404() ) {
echo '<meta name="robots" content="noindex, nofollow" />';
}
}
add_action( 'wp_head', 'add_noindex_nofollow_404' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment