Recurring Events – how to hide future events (except the next)

Home Forums Calendar Products Events Calendar PRO Recurring Events – how to hide future events (except the next)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1405319
    mnordiek
    Participant

    We have a weekly recurring event, which has been generated perfectly by The Events Calendar Pro.
    But we have one problem: Frontend visitors should only see the next upcoming event, not the future ones (and also not the past ones), because otherwise it will interfer with identical event-IDs of our booking-tool.

    We already managed to hide the “show all”-link, but the events will still be visible in the sitemap and still being indexed by Google.

    Is there a solution for only showing the upcoming event and hide all the other ones of the recurring series?

    Thanks,
    Mattz

    • This topic was modified 6 years, 5 months ago by mnordiek.
    #1405344
    Courtney
    Member

    Hi there Matthias

    When you go to Events » Settings » General » Recurring event instances, is the box checked? This might be what you were looking for.

    Let me know if that works for you.

    Thanks
    Courtney 🙂

    #1405375
    mnordiek
    Participant

    This reply is private.

    #1406278
    mnordiek
    Participant

    ** Sorry for repeating, but couldn’t change back the last answer from ‘private’ **

    Hi Courtney,

    yes the field is checked. So it only appears the next event, if i go directly into this series, this works correctly. But all next events are also active in the system, what means they are findable by sitemap and google because of internal links.

    What i need, is all the future events being seit to “draft” or similar until they are the next upcoming one.

    Best,
    Mattz

    #1406850
    Courtney
    Member

    Hi Mattz

    Our plugin won’t do that without some advanced customizations. We’re limited in helping with those customizations, per our Scope of Support / Terms.

    However, I can give you a bit of a starting point. Add this snippet to either your child theme’s functions.php file or use the My Custom Functions plugin. 

    Example code to use tribe_is_past_event to noindex only past events:

    function tribe_noindex_day_view() {
        
        if ( tribe_is_past_event() ) {
            echo ' <meta name="robots" content="noindex,follow" />' . "\n";
        }
    }
    
    add_action( 'wp_head', 'tribe_noindex_day_view' );
    

    If you want to prevent past and future events from being indexed he could use something like:

    if ( tribe_is_event() && ! tribe_event_is_on_date( $date, get_the_ID() ) )
    

    OR:

    function tribe_noindex_day_view() {
        $date = date( 'Y-m-d' );
    
        if ( tribe_is_event() && ! tribe_event_is_on_date( $date, get_the_ID() ) ) {
            echo ' <meta name="robots" content="noindex,follow" />' . "\n";
        }
    }
    
    add_action( 'wp_head', 'tribe_noindex_day_view' );
    

    Is there anything else I can help you with?

    Thanks
    Courtney 🙂

    #1407212
    mnordiek
    Participant

    Hi Courtney,
    thanks for the snippets. Though i think, only using the ‘noindex’ tag to make events unvisible is a bit optimistic regarding the delay of google bot reacting to changes.

    In my opinion, it would be better to have an option like:
    O Change past event status to “draft”
    O Change all future events except the next to “draft”

    Best,
    Mattz.

    #1408203
    Courtney
    Member

    Hi Mattz

    That would be a fun feature. I do hope you can push on with this to get the effect you want.

    Unfortunately, we’re limited in helping with customizations, per our Scope of Support / Terms.

    If you think that is something you would like as a feature I encourage you to visit our User Voice Page and either upvote an existing request or make a new request there.

    You can suggest it it http://tribe.uservoice.com.

    Thanks
    Courtney 🙂

    #1421458
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Recurring Events – how to hide future events (except the next)’ is closed to new replies.