Sybre Waaijer on "[Plugin: The SEO Framework] Duplicate canonical link tags"

ساخت وبلاگ

Hi Sybre,

On my homepage I have 2 canonical link tags the only difference being the quotation marks "" ''.

<link rel="canonical" href="https://example.com/" />
<link rel='canonical' href='https://example.com/' />

I'm not sure if this is a plugin, theme or wordpress problem.

WordPress 4.5.3
Buddypress 2.6.2
The SEO Framework 2.6.6.2
Twenty Sixteen theme
Plus various other plugins I wouldn't think were involved.

Any ideas?
Thanks in advance,
Paul

https://wordpress.org/plugins/autodescription/

I should really have looked into this further before asking the question, sorry!
The first link tag is generated by The SEO Framework and uses the quotation marks " ". Which is fine.
The problem with the second link (which uses ' ') is generated I believe by another plugin or theme. My problem is I can't fathom which one. It appears on line 127 on this test site

http://bud.paulbeacham.co.uk

* html body { margin-top: 46px !important; } }
</style> <link rel="alteate" type="application/rss+xml" title="My Blog | Site Wide Activity RSS Feed" href="http://bud.paulbeacham.co.uk/activity/feed/" />
<link rel='canonical' href='http://bud.paulbeacham.co.uk/' />
</head>

Thanks,
Paul

Hi Paul,

The issue lies in none of the mentioned plugins. It's also not caused by JetPack or bbPress.

Are there any other plugins you have active? From there I can inspect what's causing this issue.

Thanks and have a great day!

paulpdb
Member
Posted 56 minutes ago #

Hi Sybre,

I'm pretty sure it's Buddypress.
I have deactivated most plugins leaving 3 plugins active Buddypress, Jetpack and The SEO Framework.
When I deactivate Buddypress the 2nd canonical link tag no longer appears. When I reactivate Buddypress it reappears. All 3 plugins are the latest versions as is WordPress.

I'll wait to hear from you before raising this with Buddypress support.

Thanks,
Paul

Well done Paul!

I've been able to replicate it on BuddyPress pages and I've found a fix.

Please use the following snippet to remove BuddyPress' canonical URL output. I'll be sure to add it myself in The SEO Framework 2.7.0 as well.

remove_action( 'wp_head', '_bp_maybe_remove_rel_canonical', 8 );

You can place that piece of code in your theme's functions.php file.

I hope this helps! Have a wonderful day :)!

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 387 تاريخ : دوشنبه 18 مرداد 1395 ساعت: 7:23