• Resolved mrwweb

    (@mrwweb)


    Search Console alerted me to a new error where the main Events page (the list view) has noindex from the following code:

    <meta name="robots" id="tec_noindex" content="noindex, follow">

    That page currently is displaying no events which might be relevant.

    Possibly related to this very similar thread.

    WordPress version: 6.4.2
    TEC Version: 6.2.9

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Frank Remmy

    (@frankremmy)

    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,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Events List View has noindex’ is closed to new replies.