Yoast Metadata API to adjust/override the meta description

I think you’re on the right track here. You can use the wpseo_metadesc filter to alter the meta description any way you want. Check out below code, maybe it’ll help you with your function. add_filter( ‘wpseo_metadesc’, ‘my_custom_meta_description’ ); function my_custom_meta_description($description) { if ( !$description || empty($description) ) { global $post; $content = get_the_content($post->ID); if ( … Read more

How to use the Yoast SEO wpseo_canonical filter to set a canonical URL for /, /au/ & /uk/ sites in a MU environment

How would I use wpseo_canonical filter to set a canonical URL for the posts in www.example.com/uk/? E.g. the blog post www.example.com/uk/blog/post-1/ should have a canonical URL of www.example.com/blog/post-1/ I believe. I don’t know if that should be the canonical URL, but if you are asking how can that be done, then this would do it, … Read more

How to Modify Breadcrumb Page Names for Specific Pages? [closed]

We generally don’t answer plugin-specific questions here so you may find more help in a Yoast-specific forum. To point you toward the right direction, though, there is a filter called wpseo_breadcrumb_output. In either a custom plugin or your theme’s functions.php file, you can add something to the effect of add_filter(‘wpseo_breadcrumb_output’, ‘change_breadcrumb_names’); function change_breadcrumb_names($output) { if(is_page(12)) … Read more