WPML / SEO Press Plugin - Sitemap issues

Hi guys,
I was asked to reach out to the theme developers to troubleshoot the below issues further, can someone look into it for me?

Translated pages in WPML are not included in SEOPress sitemap.

I asked SEOPress to look into it, they raised the issue with WPML support, they identify that it must be a theme related issue because it works ok on default WordPress theme. Their response below:

"WPML has tested your site with the default WP theme and it works as expected.
So, there is probably somewhere in your theme a hook that filter the WP Query or our sitemap query.
I encourage you to contact the theme author to see if we can provide details about this
"

Hello Rafal,

To better assist you with your issue, kindly provide us access to your site so that we can check your settings. Please create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: How The Forum Works

Best Regards.

1 Like

Hi,

Done.

Thanks

Hey Rafal,

We are currently investigating this. Please stay tuned.

Thanks.

Hi Rafal,

Although this is a 3rd party plugin, would you mind providing more information about the issue?

  1. How we can reproduce the issue
  2. Which sitemap has the issue
  3. Which pages are missing

This is because the sitemap is static, the way I’m currently seeing it, there is no information that defines the language on sitemap for it to list it, like lang=en or similar, so I’m not really sure how the sitemap behaves. I can’t promise any solution, but if this happens to be theme/builder related then I’ll add this as a feature request.

And the theme will not block any database query related to language, what it can only affect are features that are trying to access the content created in the builder. Hence, it should have no issues getting a translation URL (eg. Spanish for example) of another URL ( eg. English page). All language switching are done by WPML, the theme and builder only supply the content based on the current/active language.

Thanks!

Hi there,
I’ll provide all links and references as private note, as I don’t want them to be index by Search engines.

Majority of the pages are already translated into another language by using WPML, and while Pro theme is activated, if you navigate to first link which is SEO Press sitemap page, you will see that only ENG version of the site are listed there.

Now, go inside Themes, and activate default WordPress 2020 theme, and check SEOPress Sitemap again, now you will see that all translated pages are included with the Sitemap.

Does this make more sense now?

Hi Rafal,

I recommend contacting the SEO Press developer and force and have the suppress_filters set to true for sitemap page. Our theme has this integration and it’s global

  public function pre_get_posts( $query ) {

    global $sitepress;

    if ( ! is_callable( array( $sitepress, 'switch_lang' ) ) || ! is_callable( array( $sitepress, 'get_current_language' ) ) ) {
      return $query;
    }

    if ( isset( $query->query_vars['cs_all_wpml'] ) && $query->query_vars['cs_all_wpml'] ) {
      return $query;
    }

    // $sitepress->switch_lang( $sitepress->get_current_language() ); //Make sure that even custom query gets the current language

    $query->query_vars['suppress_filters'] = false;

    return $query;

  }

If we globally change that on that part, it will then affect the integration of our theme to WPML.

And our theme doesn’t even no know which is the sitemap request since it’s not part of our theme, hence the condition and fix should be apply to sitemap request on their plugin.

if ( is_sitemap_page_request () ) { //Their sitemap condition here

$query->query_vars['suppress_filters'] = true;

}

If fact, they can modify the query entirely to include all posts regardless of language. It just happens the sitemap solely rely on default query controlled by WPML, hence suppressing any WPML feature have an effect too.

The reason it’s working on Twenty Ten is because it doesn’t have WPML integration.

Thanks!

Hi Rad,
Thanks for the info. I will copy your comment and I’ll send to SEOPress developers. I will let you know.

Many thanks.

Hi @rafalkukla,

Please let us know the feedback from the plugin author.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.