How to rewrite title- and meta-description templates for page templates in Yoast Plugin [closed]

You may consider the use of both filter wpseo_metadesc (for meta description) and wpseo_title (for title). The idea is to change the values of title and/or description depending if you meet some condition.

So your code will look to somthing like this:

add_filter('wpseo_metadesc','custom_meta');
function custom_meta( $desc ){

    if (/* do your test here to check template or any other values*/) {
        $desc = "Change the description";
    } 

    return $desc;
}
add_filter('wpseo_title','custom_title');
function custom_title( $title ){


    if (/* do your test here to check template or any other values*/) {
        $title = "Change the title";
    }   
    return $title;
}

You can for example consider the function is_page_template() for your test.