• Resolved willss

    (@willss)


    Hey Sybre,

    So this page is an archive page that I can’t edit the title tag on since I don’t have access to it in the backend, it’s auto-created by the Events Calendar plugin.

    As you can see, the Meta Title is “Untitled | Inossining.com”

    If I deactivate TSF, the Meta Title reverts to how it’s coded by the Events Calendar: “Events for October – InOssining.com”

    Do you know why this would be happening and what I can do to fix it?

    Thank you,
    Will

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey Will! One of the solutions is to disable TSF for Events Calendar and let that plugin manage it’s pages. You can do that by navigating to SEO > SEO Settings > General Settings > Post Types and clicking on Events.

    I personally don’t use Events Calendar, but judging from their demo site, it looks like their plugin is supplying it’s own metadata for each event, and also on events archive page.

    From what I can tell, you would still benefit from using TSF on these pages, because TSF provides additional metadata. This requires custom filter, that would prevent title manipulation either from TSF or EC. I assume that could by achieved by modification of similar filter for Yoast SEO. This should be done either by Sybre, or EC’s support team, because they have intimate knowledge of current, inner workings of respective plugins.

    Lastly, I’ve noticed you own pro version of EC plugin, so you can also open support topic on their forums — from brief glance it looks they are rather friendly bunch that is open to requests and modifications. In ideal case, it would be beneficial for all users, if the solution finds it’s way to their Knowledgebase.

    That is all from me, Sybre will drop by later. Until then, have a nice day ??

    Thread Starter willss

    (@willss)

    Hey Pierre, thanks for the feedback!

    I can’t disable TSF for events calendar, as then all of the pages are removed from the XML sitemap and I don’t want to do that.

    Seems odd that TSF is making the Title Tag “untitled”, no?

    I’ve dealt with Events Calendar support and although they are friendly, they usually don’t offer much in the way of custom code unless it’s already in their knowledgebase.

    Here is the filter you’re talking about. It looks like maybe with the same code but specific to TSF, it could work?:
    <?php
    // Prevent Yoast from changing Event Title Tags for Event Views (Month, List, Etc,)
    add_action( ‘pre_get_posts’, ‘tribe_remove_wpseo_title_rewrite’, 20 );
    function tribe_remove_wpseo_title_rewrite() {
    if ( class_exists( ‘Tribe__Events__Main’ ) && class_exists( ‘Tribe__Events__Pro__Main’ ) ) {
    if( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || tribe_is_map() || tribe_is_photo() || tribe_is_week() ) {
    $wpseo_front = WPSEO_Frontend::get_instance();
    remove_filter( ‘wp_title’, array( $wpseo_front, ‘title’ ), 15 );
    remove_filter( ‘pre_get_document_title’, array( $wpseo_front, ‘title’ ), 15 );
    }
    } elseif ( class_exists( ‘Tribe__Events__Main’ ) && !class_exists( ‘Tribe__Events__Pro__Main’ ) ) {
    if( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() ) {
    $wpseo_front = WPSEO_Frontend::get_instance();
    remove_filter( ‘wp_title’, array( $wpseo_front, ‘title’ ), 15 );
    remove_filter( ‘pre_get_document_title’, array( $wpseo_front, ‘title’ ), 15 );
    }
    }
    };

    Hello again ?? The snippet I linked is for Yoast only. For example WPSEO_Frontend is Yoast’s class for the SEO frontend output and removing default WordPress output.

    I’m actually not even sure if that snippet still works for Yoast, so I’m pretty confident it is not going to work for TSF ?? You have to wait for Sybre, I’m sorry I can’t be of help at the moment. ??

    Thread Starter willss

    (@willss)

    yeah that’s what I meant, changing out the code specific to Yoast to make it work for TSF…thanks for looking into it anyway!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Will,

    The Calendar page can’t be optimized for SEO, regardless, because The Events Calendar plugin directs noindex by default on these pages, and sets its own query. See this thread:
    https://github.com/sybrew/the-seo-framework/issues/176#issuecomment-425440994

    In any case, it would be nice to see the correct title in the browser tab. I think this snippet will do:

    add_filter( 'the_seo_framework_title_from_generation', function( $title, $args ) {
    
    	// Ignore custom queries.
    	if ( $args ) return $title;
    
    	// Tribe events' title function can't be found.
    	if ( ! function_exists( 'tribe_get_events_title' ) ) return $title;
    
    	// Is events overview page... I think
    	if ( function_exists( 'tribe_is_events_home' ) && tribe_is_events_home() ) {
    		$title = tribe_get_events_title( false ) ?: $title;
    	}
    
    	return $title;
    }, 10, 2 );

    It’s proactive instead of defensive, this means TSF can apply its global title settings to it.
    But, it’s also untested, so please let me know if you’re still finding issues.

    I hope this helps! Cheers ??

    P.S. You can surround code blocks with backticks (`) or the “code” button, it’ll make them legible ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bug in Archive Page Title Tag Rewriting?’ is closed to new replies.