• Resolved frizzel

    (@frizzel)


    I’m working on an updated website where I replaced Yoast SEO with SEO Framework. So far, so good (or rather: better in many ways). Except for one thing: the xml sitemap function when you have more than 1 language. In my current site (with Yoast) I have separate sitemaps for each language (English and Dutch). Which is great for geotargeting the Dutch pages to The Netherlands, whereas the English pages are ‘global’. Which I have set up like that in Google Webmaster Tools.

    There seems to be no way to get the same functionality with SEO Framework. Or is there (e.g. with a function like I do with Yoast) to get this accomplished?

    If it helps, this is the code I use with Yoast to get separate sitemaps (using WPML for translations):

    
    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 topic was modified 8 years ago by frizzel.
    • This topic was modified 8 years ago by frizzel.
    • This topic was modified 8 years ago by frizzel.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @frizzel, hope you are doing well and good πŸ™‚ Looking at this post, WPML actually considered your request as an unwelcome behavior, unless your language versions are at sitting at different domains/subdomains. They (imho correctly) suggest you should have only one sitemap for all languages in most cases.

    I must say I agree with WPML for once, there is no tangible SEO benefit of having per language sitemap. Unless I’m missing something, which is entirely possible.

    I have separate sitemaps for each language (English and Dutch). Which is great for geotargeting the Dutch pages to The Netherlands, whereas the English pages are β€˜global’.

    Can you tell us how is it good for geotargeting? As far as I know, submitting 2, 3 or 10 sitemaps makes no difference in crawling or indexing. Option to submit multiple sitemaps is there mainly because some websites have extraordinary amount of pages to index.

    @cybr, the plugin author is also from Netherlands and probably has some experience with your specific duo of languages, so he might chime in on this πŸ™‚

    I humbly think that if you really want to target world vs. country, you should use separate TLDs β€” and even that only makes sense in some scenarios.

    To my knowledge, there is currently no filter/function to make separate sitemaps per language. However, @cybr always followed through on suggestions that were beneficial for users, so if there is any other than cosmetic benefit to per–language sitemap, I want on that too! πŸ™‚

    • This reply was modified 8 years ago by Pierre LeBaux. Reason: clarification
    Plugin Author Sybre Waaijer

    (@cybr)

    *chimes in* (@lebaux’s response got moderated, he asked me to chime in…)

    A sitemap should be generated for every language, separately.
    Depending on your WPML settings, there are different ways accessing it.

    Not having a sitemap index file is perfectly fine, as you can submit them separately via Search Console.

    So, could you tell us whether you’re using “subdomain, subdirectory, or query-string” translations?
    And, if you could share the URL of the site in question, then that would also be greatly appreciated πŸ™‚

    Cheers!

    Thread Starter frizzel

    (@frizzel)

    Hi Sybre (@cybr), thanks for the quick response. The Dutch translation is in a subdirectory: /nl/. I know it would probably be better to have it in a subdomain, but it has been like this for years, so I’m a bit hesitant to change it.

    The site url, hm, I know there are a few problems, that’s one of the reasons I’m working on an update, but anyway: English (main site) and Dutch

    Thanks for your help.

    Thread Starter frizzel

    (@frizzel)

    Hi Sybre (@cybr), thanks for the quick response. The Dutch translation is in a subdirectory: /nl/. I know it would probably be better to have it in a subdomain, but it has been like this for years, so I’m a bit hesitant to change it.

    The site url, hm, I know there are a few problems, that’s one of the reasons I’m working on an update, but anyway: English (main site) and Dutch

    Thanks for your help.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @frizzel,

    Simply attach this to the home URL of either site and you’ll see a unique sitemap:
    /sitemap.xml

    e.g.:

    example.com/sitemap.xml
    example.com/nl/sitemap.xml

    In any case, these forums are for The SEO Framework. You’re using AIOSEO, not TSF πŸ˜‰

    Regardless, good luck with updating πŸ™‚
    Although… the site already looks good to me! I just dislike the “assisted/smooth” scroll, as it doesn’t help with accessibility.

    Cheers!

    Thread Starter frizzel

    (@frizzel)

    Thanks @cybr. I know I’m not using TSF on the live site, TSF is on the development site only for now.

    When I try your suggestion on the development site, in both cases I get a sitemap for both languages, only the link at the very top in the sitemap (the Home link) changes for the expected language. The rest is just both EN and NL.
    Maybe I’m missing something?

    And yeah, the ‘smooth’ scroll is going to be removed in the new version… πŸ˜‰

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @frizzel,

    I’ve been able to reproduce your findings. As such, I’ve escalated it to GitHub:
    https://github.com/sybrew/the-seo-framework/issues/293
    We can continue there, so I’m leaving this topic marked as resolved.

    This issue doesn’t affect SEO, so it’s “OK” for now. It’ll take a few hours of digging to find the cause, which I’m going to do for the upcoming patch.

    As always, thanks for sharing your findings, helping TSF becoming a better product πŸ™‚

    Thread Starter frizzel

    (@frizzel)

    Thank you @cybr I’ll wait for the patch in an upcoming release.
    And, uhm, TSF is already a great product, but yeah this thing bothered me.
    Thanks a lot for being so responsive and helpful!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Sitemap per language’ is closed to new replies.