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 … Read more

How to override the title tag for woocommerce endpoints?

If you added custom WC endpoints on init, you can use something like this instead to check for endpoints (adjust accordingly if you’re using Yoast): function add_custom_endpoints_to_title( $post_title ) { if ( ! is_account_page() ) { return $post_title; } global $wp; if ( isset( $wp->query_vars[‘custom_endpoint_1’] ) ) { $post_title=”Custom Endpoint 1″; } elseif ( isset( … Read more