Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active April 21, 2016 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzocaum/f0fd46862ca42476aa9497e18e8ec8bf to your computer and use it in GitHub Desktop.
Save lorenzocaum/f0fd46862ca42476aa9497e18e8ec8bf to your computer and use it in GitHub Desktop.
How to add noindex nofollow to the event listings page for Event Espresso 4

The following can be added to a site specific plugin or through a child theme's functions.php file.

<?php
//* Do NOT include the opening php tag

//* Add noindex nofollow to the Event Espresso event listings page
function ee_noindex_nofollow_event_listing_page() {
    if( is_post_type_archive('espresso_events') )
        echo( '<meta name="robots" content="noindex,nofollow" />' );
}
add_action( 'wp_head', 'ee_noindex_nofollow_event_listing_page' );
@lorenzocaum
Copy link
Author

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment