Last active
August 24, 2018 14:10
-
-
Save jrstaatsiii/a07f0faf661b67923fe4f7dd938e9a24 to your computer and use it in GitHub Desktop.
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 | |
// only no index all events archived | |
add_action('wp_head', 'no_index_event_archives', 10, 3); | |
function no_index_event_archives() { | |
if ( ! is_post_type_archive('tribe_events') ) | |
return; | |
echo '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">'; | |
} | |
// only no index past event archives | |
add_action('wp_head', 'no_index_paged_event_archives', 10, 3); | |
function no_index_paged_event_archives() { | |
if (is_post_type_archive('tribe_events') && is_paged() ) { | |
echo '<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">'; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment