WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WordPress SEO by Yoast] Canonical issues with CPT Archives using Custom Post Archive

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

  • UsagiYojimbo
    Member

    @usagiyojimbo

    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() );

    with

    } 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

    http://wordpress.org/extend/plugins/wordpress-seo/

  • The topic ‘[Plugin: WordPress SEO by Yoast] Canonical issues with CPT Archives using Custom Post Archive’ is closed to new replies.