Automatically add a "noindex" meta tag to past events' detail pages to prevent them from…
This plugin is an add-on for Modern Tribe’s The Events Calendar plugin. It adds a “noindex” meta tag to the individual detail pages for events after their end date has passed, to prevent them from appearing in search engines like Google or Bing.
Note that this only takes effect the next time a search engine indexes your site, so past events may still appear in search results for a few days.
Removed priority from add_action(‘pre_get_posts’, ‘r34npe_search_exclude’); because it wasn’t working.
Switched time() to current_time() to account for WP time zone handling.
Added logic to exclude past events from WP search results.
Updated “Tested up to” to 4.7.
Added admin message if The Events Calendar plugin is not activated.
Initial release in WordPress Plugin Directory.