Yoast SEO
[Plugin: WordPress SEO by Yoast] Wrong rel="canonical" and prev/next only on front page (2 posts)

  1. ispreview
    Posted 4 years ago #

    WordPress version: 3.3.2
    WordPress SEO version: 1.1.9

    I expected the plugin to do this:

    It seems that the paginated links from my main front page show the wrong links in your SEO plugin (same on the default templates and I use the 'latest posts' and not 'static page' method).

    Essentially they should be reflecting the fact that I have a custom 'Permalink' structure, which puts an /index.php/ into the URL. Don't ask why but this is necessary for my setup. My custom permalink structure is thus "/index.php/%year%/%monthnum%/%postname%.html". Works fine for almost everything.

    Instead it did this (example taken for page 3 of my front page):

    <link rel="canonical" href="http://www.mysite.co.uk/page/3" />
    <link rel="prev" href="http://www.mysite.co.uk/page/2" />
    <link rel="next" href="http://www.mysite.co.uk/page/4" />

    Now if it was working correctly that should show as:

    <link rel="canonical" href="http://www.mysite.co.uk/index.php/page/3" />
    <link rel="prev" href="http://www.mysite.co.uk/index.php/page/2" />
    <link rel="next" href="http://www.mysite.co.uk/index.php/page/4" />

    The plugin works fine on all other pages, but it refuses to reflect "/index.php/" from the front page.


  2. ispreview
    Posted 4 years ago #

    I was able to remove the canonical line by using this in functions.php.

    add_filter('wpseo_canonical', '__return_false');

    But the same doesn't work for 'wpseo_next_rel_link' or 'prev' link, which is odd as the API Doc's suggest they should. Any idea how to get rid of these?

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic


No tags yet.