Skip Navigation

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

Problem:
I'm using different domains per language and the sitemap of Yoast SEO not working correctly. The first domain appears in the second language sitemap and vice versa.
Solution:
This issue is related to the transient caching of Divi builder which is compatible with Yoast SEO. Please follow the workaround below to fix the issue:

- IMPORTANT: Please backup your database and website before proceeding.

- Edit the file /wp-content/plugins/wp-seo-multilingual/classes/class-wpml-wpseo-xml-sitemaps-filter.php

- Around line 77, change the code from

add_filter( 'wpseo_enable_xml_sitemap_transient_caching', [ $this, 'transient_cache_filter' ], 10, 0 );

to this one

add_filter( 'wpseo_enable_xml_sitemap_transient_caching', [ $this, 'transient_cache_filter' ], PHP_INT_MAX, 0 );

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 Long Nguyen 1 year, 7 months ago.

Assisted by: Long Nguyen.

Author Posts
November 1, 2023 at 6:05 am #14705213

robS-30

Link to a page where the issue can be seen: hidden link
The ramset.com.au sitemap is reflecting with the newzlead ramset.co.nz sitemap.
Could you please check it and resolve ASAP.

sitemap.png
November 1, 2023 at 7:17 am #14705381

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Rob,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

If you are using different domains per language, each domain will have its own sitemap URL and links to the translation content. I think you can try to recreate the sitemap. Please check the following article from the Yoast documentation on how it should be done: hidden link

After doing this procedure, remember to clear all cache existing in the website (from any plugins and also server-side, if you have them enabled).

If it doesn't work, then we might be facing an interaction issue with a third-party functionality, in this case:

- Deactivate all the plugins that are not related to WPML and Yoast
- Switch for a moment to a WordPress default theme like Twenty Twenty-one
- Try to recreate the sitemap again. If the issue is gone, activate one by one to see with which one there is an interaction issue.
❌ IMPORTANT: Please backup your database and website before proceeding ❌

I also recommend updating WPML plugins to the new version (WPML 4.6.7 and String Translation 3.2.8) and increasing WP memory limit: the minimum requirements are 128M, but we do recommend 256M and the debug information of your site shows it set to 40M. Please check this link for more details https://wpml.org/home/minimum-requirements/.

Look forward to your reply.
Thanks

November 1, 2023 at 8:23 am #14705777

robS-30

Hi Long,
Thank you for the information. I followed the steps you recommended. I've updated the necessary plugins to the latest versions and cleared the cache. However, the sitemaps for both domains are still not functioning as expected.

When I search for hidden link and hidden link, it appears that the Australian site's sitemap is displayed for both domains.

Also if we check the sitemaps the newzlead sitemap is showing for australia domain.

Could you please check and get back.

November 1, 2023 at 9:28 am #14706117

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Look forward to your reply.
Thanks

November 3, 2023 at 9:06 am #14723635

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

It sounds like a sort of caching issue. If I go to Yoast > Settings > Disable Sitemap feature > Save and re-enable it, then the NZ domain displays in both sitemaps.
Can you please contact your hosting/server support and ask them if there is a caching module enabled, turn it off for a while and recheck the issue.

I tested on our Cloudways server with a clean installation and did not see that issue:
hidden link
hidden link

Look forward to your reply.
Thanks

XML Sitemap 2023-11-03 16-00-55.png
XML Sitemap 2023-11-03 16-01-50.png
November 3, 2023 at 11:24 am #14725251

robS-30

Hi Long,
I have disabled my cache in the Ngnix server. Also, I have deactivated the Wp-Rocket. Then I checked by enabling and disabling the sitemap features in the YOAST seo but still the issues is presisting. Please check and let me know.

November 6, 2023 at 1:48 am #14734315

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I'm asking our 2nd tier support about this issue and I will update you here when I have something to share.

Thanks.

November 7, 2023 at 6:39 am #14743155

robS-30

Hi Long,
Did you check with the 2nd tier support to resolve this issue. Please let me know the status. The issue is presisting in the live site too.

November 9, 2023 at 1:33 am #14761765

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I got some info from our 2nd tier support: this issue is related to the transient caching of Divi builder which is compatible with Yoast SEO. To fix this on your live site, please follow steps below:

- IMPORTANT: Please backup your database and website before proceeding.

- Install and activate the plugin WPML SEO (https://wpml.org/documentation/related-projects/wpml-seo/)

- Edit the file /wp-content/plugins/wp-seo-multilingual/classes/class-wpml-wpseo-xml-sitemaps-filter.php

- Around line 77, change the code from

add_filter( 'wpseo_enable_xml_sitemap_transient_caching', [ $this, 'transient_cache_filter' ], 10, 0 );

to this one

add_filter( 'wpseo_enable_xml_sitemap_transient_caching', [ $this, 'transient_cache_filter' ], PHP_INT_MAX, 0 );

Look forward to your reply.
Thanks

November 13, 2023 at 10:52 am #14787539

robS-30

Thanks long, the solution you provided is working fine.