Trying to change the Yoast SEO meta title dynamically using the $_GET superglobal URL parameter? All you may need is to use the wpseo_title hook.
1 answers
1
Changing meta title using $_GET URL parameter
To change the Yoast SEO meta title using the $_GET superglobal URL parameter you should use the wpseo_title hook as per below.
function custom_title( $title ) { if ( $_GET['type'] && is_archive() ) { $title .= ' - ' . filter_var( $_GET['type'], FILTER_SANITIZE_STRING ); } return $title; } add_filter( 'wpseo_title', 'custom_title', 15 );
— Support WizardAnswer 1