[Resolved] Non-canonical paginated URLs have the hreflangs instructions
This thread is resolved. Here is a description of the problem and solution.
Problem:
Hi, I did a scan with the "Website Auditor" of the SEO PowerSuite and it gives me back 274 errors under "Localization" ---> "Missing Return Links".
The issue is that non-canonical paginated URLs have the "hreflangs" instructions in the code while there should be none in case the canonical URL of the page is different.
Solution:
In the end, the issue seems to be related to an Elementor module not compatible with Yoast.
This is from the Yoast Support team:
"Yoast SEO utilizes the built-in WordPress core functions to recognize pagination. The blog page on your site uses an Elementor module to add pagination to the blog page instead of using the WordPress core static blog page. For Yoast SEO to detect pagination on a non-static blog page, a manual page break must be included in the content."
0% of people find this useful.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Hi, I did a scan with the "Website Auditor" of the SEO PowerSuite and it gives me back 274 errors under "Localization" ---> "Missing Return Links".
This is a video explanation of what I see in Website Auditor, so that you can have a better idea:
hidden link
After that, I contacted the SEO PowerSuite support and they gave me back a detailed explanation of the issue that I forward here:
"I have examined your project, and I can see that the issue is that non-canonical paginated URLs have the "hreflangs" instructions in the code while there should be none in case the canonical URL of the page is different." (see also the screenshot attached).
thanks for sharing information and video, it is very helpful.
It happens because the URL that actually gives the error is not an actual page, it still the same page but for example pages-2 was added to URL, so it can load blog posts from blog elements from page 2. In page source you shared you can see the canonical URL is still /blog/ while actual URL loaded is /blog/4/. Thus hreflangs are not correct.
I think this is the problem since the canonical URL is wrong.
Furthermore, the rel="canonical", rel="prev", and rel="next" are not being set by WPML.
WPML only sets the rel="alternate" hreflang. In your case I think Yoast SEO is adding Canonical URLs.
1) Disable all WPML plugins and check page source (CTRL+U) and canonical URL for blog page 2
2) Disable all other plugins except for WPML plugins, Yoast and Elementor
- Switch to WP default theme
- Go to Blog and go to page 2
- Check page source (CTRL+U) and canonical URL
3) Create a new page and add Elementor default blog element
- Go to Blog and go to page 2
- Check page source (CTRL+U) and canonical URL
I would recommend making a backup just in case something goes wrong. If possible you can also create a staging site, where we can do that testing. Most of the hosting offers this option to create staging site, with the click of the button.
Otherwise, make sure you have a backup before proceeding. It shouldn't do anything and nothing should not go wrong, but it is better to have a backup just in case.
I realized 3 tests on a staging version of the site, the first two you suggested, and another one (only deactivating Yoast Plugins). I was not able to try case 3, as I did not understand clearly what I've to do.
Also, I share with you the last reply from Yoast Support, with attachment:
"In our testing with v14.2 of Yoast SEO Premium, WPML v4.3.14 and Yoast SEO Multilingual v1.1.1 we are unable to reproduce the issue on a basic theme. On a translated blog pagination page the right canonical appeared and the hreflang tags did not appear. See attached. If you are not using those versions of the plugins please update and see if the issue resolves."
Note: every version I'm using is updated and there is apparently no conflict between plugins.
thanks for taking the time to test and sharing all the info.
So in Case 1 and Yoast SEO support confirmed it, the problem is probably coming from your theme/ Elementor widget issue with Yoast SEO.
When on page 2, canonical URL should be page-2 as in image Yoast SEO support share.
In test case 1 you can see the issue still exist when WPML plugins disabled, URL still shows blog not page-2 as it should, which means the issue is not caused by WPML. This issue still exists when WPML disabled and on the original language page also.
My best guess would be there is an issue with the theme or Elementor widget you are using.
I would suggest contacting the theme author and confirm this issue by testing case 3 or use another Blog widget or another theme.
- Disable all plugins except Elementor and Elementor PRO
- Switch your theme to TwentyTwenty theme
- Create a new page and called it Blog test
- Edit the page with Elementor and add blog widget
- Visit the page and go to page 2, canonical URL should be page-2
Since the issue is not caused by WPML, and is still there when WPML deactivated there is not much we can do. You need to get a canonical URL correct as in the YOAST support image.
I hope you understand our case here, let me know if there is anything else I can do for you. 🙂
In the end, the issue seems to be related with an Elementor module not compatible with Yoast. This is from the Yoast Support team:
"Yoast SEO utilizes the built-in WordPress core functions to recognize pagination. The blog page on your site uses an Elementor module to add pagination to the blog page instead of using the WordPress core static blog page. For Yoast SEO to detect pagination on a non-static blog page, a manual page break must be included in the content.
Please reach out to Elementor to request compatibility with our plugin's recognition of pagination. Alternatively, you or your developer can use the wpseo_canonical, wpseo_prev_rel_link, and wpseo_next_rel_link filters to customize these tags. Some example code snippets can be found here and here."
So, I will further investigate it with Elementor's support. Thanks for your help!