The Yoast WordPress SEO plugin doesn’t support SEO for custom taxonomies.
Heres is a quick snippet to add in your functions.php file:
function cus_update_seo_title( $str ) { if ( is_tax( 'your_taxonomy_slug' ) ){ return 'here comes custom title '.single_term_title( '', false ).' and more here if required'; } else { return $str; } } add_filter( 'wpseo_title', 'cus_update_seo_title', 10, 1 );
This snippet hooks into the SEO title function and sets a new SEO title for that taxonomy. The title that is returned can include the term name (using single_term_title( ”, false )) or any other text you’d like.
The parameter $str can also be used but it will return the taxonomy name, default separator and blog name (that’s the default SEO title from the plugin) which can be annoying. I prefer not to use the returned value for the taxonomy title but you have to keep the return $str for all other titles.
No Comments Yet