Hi Robert,
Thank you so much for the kind words :).
This is an ongoing issue ever since I added sitemaps to this plugin and it has been discussed with WPML, alas no concrete solution has yet been found. This issue has been confirmed, but until today I’ve only seen it on your website.
Digging deeper (technical)
Your website has been around for quite some time and over that time many updated for both WPML and WordPress have taken place.
I’m afraid something has gone wrong with the post ID synchronization (or something like that) when you’ve upgraded WPML and WordPress in the past 3 years. These things can unfortunately happen without an evident cause as both WPML and WordPress are two separated projects.
From what I remember, I’ve already confirmed the posts contain different ID’s through a debugging plugin.
However, I assume not all language data can be correctly fetched from these, some might be outdated and unchanged, and some might have the wrong ID attached to them. Some might have the wrong slug given to WordPress core.
I use WordPress’ core get_posts() to fetch all Posts. This call is made three times, for ‘page’, ‘post’, and then for all public “post types”.
For each ID, an URL is generated. The prefix for this URL is fetched through the wpml_post_language_details
filter and then handled from your WPML settings.
Beforehand, the URL is fetched through WordPress’ own get_permalink() feature. It’s seen in action right here.
Conclusion (not technical)
With all this information, I can conclude the following things:
1. Your website has been around for quite a long time. Plugin/core issues might be present.
2. WPML might not be able to hook correctly into get_permalink()
. But I really doubt that.
3. A reset or synchronization at some point is needed.
Resolution
To follow point 3 from the conclusion, we can reset in a few ways.
I’d first like to suggest doing the following:
1. Go to /wp-admin/options-permalink.php
, hit “Save Changes”.
If that doesn’t work, continue:
2. Go to /wp-admin/admin.php?page=sitepress-multilingual-cms%2Fmenu%2Fmenu-sync%2Fmenus-sync.php
, scroll down and hit “Sync”. Perform step 1 once more.
If that doesn’t work, continue:
3. Go to /wp-admin/admin.php?page=sitepress-multilingual-cms%2Fmenu%2Ftranslation-options.php
, make a screenshot of the “Post and pages synchronization” options, and send them to me :). I believe you’ve got my e-mail address. We’ll continue from there.
I hope this helps!