Yoast SEO conflict, removes canonical – Major bug

6.22K viewsIssues
1

The Anspress plugin conflicts with Yoast SEO plugin and removes the canonical tag in the header. This is a major bug and when not aware this could lead to penalties in Google search engine.

Could you please look into this asap?

Thanks!

Hello,
Please make sure you are on latest commit. I have disabled canonical link few days ago.

I’m on the latest commit. Anspress still strips the canonical tag from all pages (even regular pages). When I disable Anspress they appear.

Works for me well.

Example?
Here is my use-case: https://goo.gl/LfXL08

When I disable Anspress, the Canonical tag appears in the html header.
And indeed, on the Anspress page the Canonical tag is present, but look at all your other pages. I think Anspress strips the tag and only inserts it back on their own pages.

For me works ok with SEO Framework. Canonicals in non-Anspress pages and posts are 100% ok.

There is one problem, in canonicals of categories, that shows always the same. But this is a minor.

I use Yoast SEO and there definitely is a major problem of all canonicals being removed expect for own Anspress pages.
I can see Anspress is hooking up on the wpseo_canonical Yoast SEO filter.

1

Hello Jef,

This issue is solved now. Thanks for reporting.

Cheers.

commented on answer
0

When I comment out the function it is fixed, so there is something wrong with the filter return parameter:

anspress()->add_filter( ‘wpseo_canonical’, ‘AnsPress_Theme’, ‘wpseo_canonical’ );

 

Edit: You overwrite the  official Yoast hook, so just use another name for it and it is fixed (ex. wpseo_canonical_ans)

commented on answer

I will check.