Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created November 4, 2016 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshfeck/77682eb14a7b4f08e3180b9eb4827cb3 to your computer and use it in GitHub Desktop.
Save joshfeck/77682eb14a7b4f08e3180b9eb4827cb3 to your computer and use it in GitHub Desktop.
Tell SEO bots to not index Event Espresso event pages. Useful if the event pages are all duplicated content.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_no_index_tagseo_meta() {
if ('espresso_events' == get_post_type() && is_single() ) {
?>
<meta name="robots" content="noindex">
<?php
}
}
add_action( 'wp_head', 'ee_no_index_tagseo_meta', 9 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment