Skip Navigation

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.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Nigel 1 year, 7 months ago.

Assisted by: Nigel.

Author Posts
October 12, 2023 at 10:31 am #14564971

andzelikaA
Site owner

Hello,
Im using latest version of wpml, wpml seo and yoast seo. I have a problem with sitemap.

Before i didnt used wpml seo additional plugin and my sitemap didnt have any translated content. After I installed wpml seo plugin only front pages and blog archives in different languages appeared in sitemap. Translated posts and pages are missing from sitemap.

I attach images.

My site url is hidden link

yoast seo archive page.png
yoast seo pages.png
October 12, 2023 at 12:06 pm #14565839

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Hi there

The translated posts should appear in the sitemap, and I just ran a quick test on my local site where I confirmed it was working as expected.

Could I ask you to try disabling the Yoast sitemap feature, clearing any caches, and then re-enabling the sitemap feature, which should cause the sitemaps to be rebuilt.

You can disable/enable the sitemap feature at Yoast > Settings under the API section of the Site features tab.

Let me know if that fixes the problem...

October 12, 2023 at 12:56 pm #14566231

andzelikaA
Site owner

I tried many times to disable sitemap feature in yoast seo, saving permalinks, enabling sitemap feature again and still same sitemap.

October 12, 2023 at 1:51 pm #14566673

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

When I check the sitemap for you web site it shows that the sitemap was last updated September 29.

If you have disabled then re-enabled the sitemap feature within Yoast it seems that the problem is that any caching in place needs to be cleared, before re-activating the sitemap feature.

See hidden link

October 13, 2023 at 9:35 am #14571615

andzelikaA
Site owner

My yoast seo sitemap is up to date.

For the exampel i added "test" page in default language. It appeared in sitemap. I also added page translation to english language and that translation is missing from sitemap.

Page in defautl language: hidden link
Translated page to english: hidden link

sitemap.png
October 13, 2023 at 11:39 am #14572703

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Sorry, could you please test one more time, only this time, disable WP Rocket before creating and translating a test page.

What does the sitemap look like then?

October 13, 2023 at 12:27 pm #14572937

andzelikaA
Site owner

I disabled wp rocket. Created new page then added translation. Default language page appeared in sitemap and english version not. Then I tried to make original page in english language, still not appeared in sitemap.

ORIGINAL LANGUAGE :
hidden link

TRANSLATED PAGE:
hidden link

ORIGINAL PAGE IN ENGLISH LANGUAGE:
hidden link

sitemapno wp rocket.png
October 13, 2023 at 12:45 pm #14573183

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Thanks for testing.

I'm not sure what to suggest next, so I'm escalating this so my colleagues can take a look.

I'll get back to you as soon as I have some feedback from them.

October 16, 2023 at 7:57 am #14582041

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Do you have a staging server we could do testing on?

In particular, as this isn't the normal behaviour, can we verify that it happens in a minimal environment to rule out conflicts from some other code?

That is, with all non-WPML plugins except for Yoast disabled, and with a default theme like twentytwentyone.

October 18, 2023 at 1:57 pm #14604859

andzelikaA
Site owner

if (isset($sitepress)) add_filter('wpseo_posts_join', 'sitemap_per_language', 10, 2);
function sitemap_per_language($join, $type) {
global $wpdb, $sitepress;
$lang = $sitepress->get_current_language();
return " JOIN " . $wpdb->prefix . "icl_translations ON element_id = ID AND element_type = 'post_$type' AND language_code = '$lang'";
}

This was added by previous developer to functions.php theme file.