Support » Plugin: Yoast SEO » Yoast sitemap error synchronizing slug with WPML

  • Resolved cloudres



    I use Yoast for the Sitemap creating and WPML to translate the web site. I’d like to ask you who can be responsible for the listing of a wrong URL inside the sitemap in your opinion.

    For example in my case /negozio is the URL for the Italian main page of my shop online and /en/shop is the correct one for English. Both URL works.

    But the sitemap made by Yoast lists /en/negozio sometimes. The funny thing is that every time in the meanwhile the products page are listed correctly (for example /en/shop/product)

    So now who is responsible for this issue? WPML or Yoast? Is it maybe a known issue?

    Thanks a lot.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Maybellyne


    Hello Griotta,

    Thanks for reaching out regarding your sitemap.

    First, Yoast generates an XML sitemap index for your site located at /sitemap_index.xml/. Just to be clear, do you mean that you find /en/negozio/ in the sitemap? You mentioned ‘sometimes’. Does this mean there are times that URL is not included? Also, can you please share the URL of your website for more context?

    Thread Starter cloudres


    Hi @maybellyne,

    it’s a company web site and I would like avoid to publish it here, please. Could we get on touch by E-Mail about this?

    About your question, I was meaning that sometimes the URL is correct, not incorrect. Sometimes it is. I don’t know what cause it. I’m trying to discover it.

    Just to be very clear, when the sitemap works correctly I see there:


    When something is not working as well, the sitemap lists:


    So when something it’s not working well, the problem seems related only to the translation of the shop main page and only when the sitemap shows this page. The URLs of the products in fact are not influenced by this as you can see on my example. “Shop” is “shop” there. “Shop” is not “shop” only on the main page of the shop, but is “negozio” (first language slug).

    I’d like send you the sitemap to show you what I mean exactly.


    Thread Starter cloudres


    WPML support suggested a fix that I paste here:

    Please try the following workaround:

    – Go to wp-content/plugins/wp-seo-multilingual/classes/class-wpml-wpseo-xml-sitemaps-filter.php

    Add the following code just above line 151 (the default case):

    case 'product':
                        if ( class_exists( 'woocommerce') ) {
                            $this->sitepress->switch_lang( $lang_code );
                            $current_lang_shop_id = apply_filters('wpml_object_id', wc_get_page_id( 'shop' ), 'page', true, $lang_code);
                            $url = get_permalink( $current_lang_shop_id );
                            $lastmod = get_the_modified_time( 'c', $current_lang_shop_id );

    Does it works for you?

    Plugin Support Michael Tiña


    Hi @griotta

    We don’t accept support questions for the free plugin over email. This is the proper channel to request for support. If you were to upgrade to Yoast SEO Premium, then we’d be able to provide personal email support.

    With that being said, could you check and make sure that everything is set up between Yoast SEO and WPML (and you have all of the necessary add-on plugins/additional setup) according to their documentation –

    We’d really also need a link to your sitemap in order to check the output further.

    Thread Starter cloudres


    The fix suggested by WPML fixed the issue on our sitemap. They said that will add it on one of next WPML releases. Thanks the same for the support!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Yoast sitemap error synchronizing slug with WPML’ is closed to new replies.