Yoast SEO
[Plugin: WordPress SEO by Yoast] Canonical issues with CPT Archives using Custom Post Archive (1 post)

  1. UsagiYojimbo
    Posted 4 years ago #

    I've experienced an issue using yoast SEO with plugin Custom post archive.

    Canonical on custom post archive created with the plugin looks like http://www.example.com/p/1.

    To make the canonical correct, you must modify class-frontend.php from the Yoast plugin and replace

    } else if ( function_exists('get_post_type_archive_link') && is_post_type_archive() ) {
    				$canonical = get_post_type_archive_link( get_post_type() );


    } else if ( function_exists('get_the_post_type_permalink') && is_post_type_archive() ) {
    				$canonical = get_the_post_type_permalink( get_post_type() );

    Hope this will help


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic