Plugin Support
Erica
(@eeide)
Hi @mrwweb,
The noindex is added for Event view URLs not listing any events. However, you can use the below snippet to turn off the noindex when the calendar is set to today – even if there are no events.
add_filter(
'tec_events_seo_robots_meta_include',
function( $do_include, $view ) {
$context = $view->get_context();
// If the shown view is for today, don't add the noindex
if ( $context->get( 'start_date' ) === $context->get( 'today' ) ) {
return false;
}
return $do_include;
},
10,
2
);
Let us know how it goes, and if you have any questions.
Thank you,
Erica
Thread Starter
mrwweb
(@mrwweb)
Thanks for the information, Erica. I very much understand and appreciate why other event views are noindex’ed when there are no events, but the primary /events/ page seems like it shouldn’t be. My $0.02.
Thanks for the snippet. I’ll probably look to tweak it a bit further to make sure it’s only targeting the primary list view.
Hello @mrwweb,
On behalf of my colleague, Erica, you’re very welcome.
I’ll close this ticket for now, but if anything else comes up, please don’t hesitate to open a new thread; we’ll be happy to help!
If you have a moment, we would really appreciate it if you could share your feedback with others. You can leave a review for The Events Calendar here.
By sharing your experience on WordPress.org, you’ll demonstrate the power of using The Events Calendar for event management to others. Plus, you’ll totally make our day. 😄
Either way, I’m here if any questions come up!
With gratitude,