Using php to overwrite or replace title tag, while using Yoast. The WPSEO plugin by Yoast has a filter for the title: ‘wpseo_title’. You’ll need to add something like this:
1 2 3 4 5 6 7 | add_filter('wpseo_title', 'filter_product_wpseo_title'); function filter_product_wpseo_title($title) { if( is_singular( 'product') ) { $title = //your code } return $title; } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.