Created
April 12, 2018 16:51
-
-
Save anwerashif/ae6ff1df63b9d020af74475aecce0368 to your computer and use it in GitHub Desktop.
Prevent GoogleBot to Index Archive Pages on Your Blog
This file contains hidden or 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
<?php | |
// Do NOT include opening tag | |
// add 'noindex' meta to archive | |
add_action( 'wp_head', 'add_noindex' ); | |
function add_noindex() { | |
if(is_archive()) { | |
echo '<meta name="robots" content="noindex,follow" />'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment