• Resolved Brent Wilson

    (@bwbama)


    In Yoast, I could easily append text to title tags such as the Tag pages.

    <title>Tag Title | Site Name</title>
    would become
    <title>Tag Title News & Articles | Site Name</title>

    for all tag pages. I could do this within the Yoast settings. What is the best way to do this with SEO Framework?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    The best way would be to manually set the tag SEO title after you’ve created the tag. So you won’t have to mess around with filters, ensuring future compatibility.

    But, if you’d rather automate that, you can use the the_seo_framework_generated_archive_title filter.

    Here’s an untested draft, use at your discretion ??

    add_filter( 'the_seo_framework_generated_archive_title', function( $title, $term ) {
    
    	$taxonomy = isset( $term->taxonomy ) ? $term->taxonomy : '';
    	if ( 'post_tag' === $taxonomy ) {
    		$title .= ' News & Articles';
    	}
    
    	return $title;
    }, 10, 2 );

    Cheers!

    Thread Starter Brent Wilson

    (@bwbama)

    Thanks for the reply. The above code worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Append Text To Tag Title Tags’ is closed to new replies.