Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
When activating WPML SEO, the secondary language's sitemap displays a 404 error. This occurs when using the 'Language in Directories' URL format.
Solution:
This behavior is expected and not a bug. When using the 'Language in Directories' format, the multilingual sitemaps generated by Rank Math do not follow the standard structure. Instead, WPML creates hreflang tags for search engines to recognize the default language and its translations. You can find more details in our documentation on optimizing multilingual websites with Rank Math and WPML: Rank Math Sitemaps and WPML.

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Also, check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum: WPML Support Forum.

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.

This topic contains 1 replies, has 2 voices.

Last updated by Itamar 1 year, 1 month ago.

Assisted by: Itamar.

Author Posts
June 24, 2024 at 10:05 am #15805308

mehdeM

Background of the issue:
I am trying to: When I activated WPML SEO, the secondary language's sitemap showed 404. I can not provide a link with the 404 Error because the site is live, and the sitemap has been submitted to Google. So, WPML SEO is deactivated now. Link to a page where the issue can be seen: hidden link

Symptoms:
Instead, I got: 404

Questions:
Why does the secondary language's sitemap show a 404 error when WPML SEO is activated?
How can I fix the 404 error for the secondary language's sitemap?

June 24, 2024 at 11:43 am #15806473

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I've discussed this issue with our compatibility team. It is expected to get 404 on the secondary language when using the Language URL format of "Language in Directories". In other words, the fact that you got 404 when accessing hidden link is not a bug and is expected. We mention the following in our Rank Math SEO guide.

If you choose other language URL formats, the multilingual sitemaps generated by Rank Math don’t follow the standard structure of multilingual sitemaps. WPML takes care of this by creating hreflang tags so that search engines know the default language of the page’s content and the translation available in different languages.

You can see it here.

https://wpml.org/documentation/plugins-compatibility/optimize-multilingual-websites-using-rank-math-and-wpml/#rank-math-sitemaps-and-wpml

If, for example, you inspect the post's sitemap here: hidden link, you can see English and Arabic posts listed there. Please see the attached screenshot. This is how it should be and not a mistake. As mentioned, WPML links the original post and its translation with an HREFLANG tag, which helps search engines identify and link between posts and their translations.

Regards,
Itamar.

2024-06-24_14-37-44.jpg