Created
January 18, 2023 12:06
-
-
Save jjmontalban/d8458f76b413254cda69f75e8b6c4972 to your computer and use it in GitHub Desktop.
Poena ano index las paginas con 404
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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