WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. UsagiYojimbo
    Member
    Posted 2 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() );

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic