Skip Navigation

Waiting for author

Topic Tags: Multilingual SEO

Overview of the issue

When using All in One SEO and WPML with the Adjust IDs for multilingual functionality option enabled (found on the WPMLLanguages page), the category-sitemap.xml file will have duplicated categories in the default language. Categories from secondary languages are not displayed.

Workaround

A permenent fix is required in All in One SEO’s codebase, but you can use a workaround for this issue in the meantime by following these steps:

  1. Open the wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Query.php file
  2. Search for the terms method (around line 227)
  3. Add the following workaround to the beginning of the method:
    
    public function terms( $taxonomy, $additionalArgs = [] ) {
    
    //WPML workaround
    if (class_exists('SitePress')) {
    global $sitepress_settings;
    // Before building the sitemap and as we are on front-end make sure links aren't translated.
    // The setting should not be updated in DB.
    $sitepress_settings['auto_adjust_ids'] = 0;
    }
    
    
  4. Open the category-sitemap.xml file (yourwebsite.com/category-sitemap.xml) and refresh the page

Next steps to resolve this issue

We’ve already let the AIOSEO team know about this issue, and we’re sure they will get it resolved quickly. If you want to check in on progress, you can reach them via their support forum.

2 Responses to “All in One SEO - Duplicated categories on sitemap”

Leave a Reply

Please leave here comments about this page only.
For technical support and feature suggestions, head to our forum. We are waiting there!

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>