Support » Plugin: Yoast SEO » Canonical URL for Category&Taxonomy Page Points to Category

  • calciumwaste


    My site structure is somewhat complicated and I’ve had a lot of issues with the rel=canonical pointing to a page that has different content, leading Google to ignore my canonical URLs. Currently Google is indexing the non-canonical pages, but they are usually outranked by a less relevant canonical URL.

    The core problem is that for a URL that has multiple taxonomies, the canonical points back to the main category archive. ie. the canonical on “” is always “”. I don’t know if this is the intended behavior for the plugin, but it does not work for me.

    Is there to fix this so that the canonical URL doesn’t remove tags or custom taxonomies from the URL?

Viewing 1 replies (of 1 total)
  • I have a similar issue, I have a fairly complicated scenario where I have set up dummy terms in custom taxonomies and use these as landing pages, I then use rewrites to extract variables and pull content in from other custom post types based on these. The ‘canonical’ ref on my custom taxonomy archive pages generated by Yoast was completely wrong. This is how I’ve disabled it:

    //Try to remove canonical on custom taxonomy archive pages
    function wpseo_canonical_exclude( $canonical ) {
    	if (is_tax()) {
    		$canonical = false;
    	return $canonical;
    add_filter( 'wpseo_canonical', 'wpseo_canonical_exclude' );

    Obviously this disables canonical for ALL custom taxonomy archives but you could check for a particular one.


Viewing 1 replies (of 1 total)
  • The topic ‘Canonical URL for Category&Taxonomy Page Points to Category’ is closed to new replies.