The Events Calendar Date in SEO Title

#1028961
  • Resolved Sascha Bröcking
    Rank Math free

    hey there. we have many dates with same title so we want to customize the page title for events and show the events date in title after the name.

    we already tried to set %title% %date% for events but %date% shows the post date instead of the event date.

    is there a tag for the eventdate or how we could show the eventdate in the page title?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    We apologize for the issue you are facing with displaying the event date in the SEO title. Unfortunately, the context provided does not specify a variable for the event date specifically in Rank Math. The %date% variable indeed shows the post date, which is why you’re seeing that instead of the event date.

    To customize the page title for events and include the event date, you may need to check if your events plugin (like The Events Calendar) offers a specific variable or shortcode that can be used in conjunction with Rank Math.

    If you have access to the documentation for your events plugin, it might provide insights on how to retrieve the event date. Alternatively, you can reply to this ticket with your site URL and any additional details, and a human agent from the Rank Math Support team will assist you further.

    Thank you for raising this concern!

    just in case anybody else is looking for a solution. we add a code snippet and now it is working:

    `add_filter( ‘rank_math/frontend/title’, function( $title ) {
    if ( function_exists( ‘tribe_is_event’ ) && tribe_is_event() && is_singular( ‘tribe_events’ ) ) {
    $event_date = tribe_get_start_date( null, false, ‘d.m.Y’ );
    if ( $event_date ) {
    // Entferne ggf. vorhandenes Datum, um Dopplungen zu vermeiden
    $title = preg_replace( ‘/\s*-\s*\d{2}\.\d{2}\.\d{4}/’, ”, $title );
    $title .= ‘ – ‘ . $event_date;
    }
    }
    return $title;
    });

    Hello,

    Thank you for sharing the filter to achieve that on the meta title.

    Please note that %date% is Rank Math’s reserved variable for date, so it won’t pull up the date from that plugin.

    However, if you have any other concerns, please don’t hesitate to contact us anytime so we can assist you further.

    Looking forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘The Events Calendar Date in SEO Title’ is closed to new replies.