Hi,
YOAST SEO is overwriting the canonical tag of the theme. That’s an issue, because Yoast injects the wrong canonical tag on my paginated front page.
On Page 2 it says http://www.domain.com/ instead of http://www.domain.com/page/2/. If I deactivate Yoast it’s all good and it shows the correct canonical.
Thank you for your help!
Hi,
the pagination on my static front page works fine, only the canonical tag is the problem.
Please take a look: http://dev.promicabana.de/wordpress/page/3/
In the source cods you see: <link rel=”canonical” href=”http://dev.promicabana.de/wordpress/” /> instead of <link rel=”canonical” href=”http://dev.promicabana.de/wordpress/page/3/” />
I deactivated all plugins, deleted all browser caches – the problem persists. I even installed a fresh copy of the Yoast Seo plugin. It’s always the same: With YOAST – the canonical tag is false; without Yoast – the canonical tags are correct.
Thank you!
HI
It seems that this is the default functionality of Yoast plugin in this regard but you can add a condition n page’s head and change it. Add bellow code in header.php like here: http://screencast.com/t/MVJqXC65t
global $paged;
if ($paged > 2) {
echo '<link rel="canonical" href="http://localhost/newsmag/' . $paged .'/">';
}
Thanks!
Hi,
I noticed, that your solution only works on categorys. But in this case it’s the wrong canonical (yoast does it right on catgeorys) and I got two canonicals there.
Please take a look: dev.promicabana.de/wordpress/homepage-fashion/page/3/
Maybe you know a solution to disalbe the Yoast canonical tag, but only for the paged frontpage-pages?
Thank you!
Hi,
It seems that Yoast is not aware of the posts pagination used on theme’s latest articles section. You could try to filter the canonical element and not return it for your homepage using wp’s conditionals.
– https://kb.yoast.com/kb/canonical-urls-in-wordpress-seo/
– https://codex.wordpress.org/Conditional_Tags
If you can’t manage this on your own we recommend you ask help from a freelancer.
Thank you!
Lucian C. tagDiv
