How can I do automatic redirects to canonical URLs as defined by Yoast SEO?

I had the exact same problem, and I believe that was probably caused because WordPress doesn’t know about the primary category (that is something added by Yoast SEO instead).

So is something that in my opinion Yoast SEO should manage, hopefully in next releases they’ll do it.

In the meanwhile it looks I’ve smoothly resolved adding even Permalink Manager (free version is ok) plugin.

It solves both these two problems

  • It adds redirects to canonical even when the permalink includes the category
  • It makes internal post and pages links point correctly to the path composed by the primary category

Could even be even just random, and maybe just a cache issue that installing Permalink Manager solved, but I’ve tried to deactivate it and I had again the same issue. So it looks that that plugin is the solution.

Please let me know if it solves the problem even in your case.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)