Skip to content Skip to sidebar

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

Problem:
You are using WPML with WooCommerce Multilingual and have noticed that translated WooCommerce product category slugs are redirected with a 302 status code instead of a 301 on separate domains per language/country. You are concerned about the SEO implications and whether it is safe to change these redirects to 301.
Solution:
We have confirmed that changing these specific WooCommerce product category redirects from 302 to 301 will not affect WPML's language negotiation, hreflang tags, canonical URLs, language switchers, or WooCommerce Multilingual functionality. It is safe to use a 301 (permanent) redirect for permanently changed category URLs to help search engines recognize them as such. Currently, there is no setting in WPML to automatically change these redirects to 301, but you can implement a custom solution using a PHP snippet. If you have an alternative PHP snippet that uses the

wp_redirect_status

filter, feel free to share it with us for review.

Please note that this solution might be irrelevant if it's outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If this does not resolve your issue, please open a new support ticket at WPML support forum.

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.

This topic contains 15 replies, has 1 voice.

Last updated by lobkeB 3 weeks, 5 days ago.

Assisted by: Paola Mendiburu.

Author Posts
May 22, 2026 at 9:32 am #18053793

lobkeB

Hi WPML support,

We use WPML + WooCommerce Multilingual with separate domains per language/country.

We noticed that translated WooCommerce product category slugs on the “wrong” domain are redirected by WPML with a 302 status code instead of a 301.

Examples:

hidden link
302 Found, x-redirect-by: WPML
hidden link

hidden link
302 Found, x-redirect-by: WPML
hidden link

hidden link
302 Found, x-redirect-by: WPML
hidden link

For normal pages, shop pages and product pages, WordPress seems to handle these redirects as 301, which is good. But for WooCommerce product category archives, WPML handles them as 302.

Our questions:

Is this expected WPML behavior for translated WooCommerce product category slugs?
Is there a setting to make these redirects 301 instead of 302?
If there is no setting, is there an official WPML hook/filter we can use to change these category redirects from 302 to 301?
Would it be safe to add our own PHP snippet that catches wrong translated product category slugs and redirects them with a 301 to the correct local category URL before WPML applies its 302?
Could changing these category redirects to 301 cause any problems with WPML language negotiation, hreflang, canonical URLs, or WooCommerce Multilingual?

Context: the affected URLs are not temporary alternatives. They are wrong language slugs on country domains, and we want Google to understand that the correct local category URL is the permanent version.

Thanks!

May 22, 2026 at 1:33 pm #18054546

lobkeB

We found a suggested workaround online:

add_filter( 'wpml_redirect_response_code', function() {
return 301;
} );

Can you confirm whether `wpml_redirect_response_code` is an official/current WPML filter?

If yes:

* Does it affect all WPML redirects globally?
* Is it safe to use on a WooCommerce Multilingual site with separate domains per language?
* Can it be limited only to WooCommerce product category archives / translated product category slugs?
* Could it negatively affect browser language redirects, language switcher behavior, currency/language cookies, hreflang, or canonical URLs?

We only want to change the redirect status from 302 to 301 for wrong translated product category slugs on the wrong country domain, for example:
`/beheizbare-handschuhe/` on the French domain → `/gants-chauffants/`.

May 25, 2026 at 8:45 am #18057494

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting us

I checked the official WPML Hooks Reference, and I could not find a documented hook to change WPML’s redirect response code from 302 to 301. The available redirect-related hook is wpml_is_redirected, but it only allows disabling WPML canonical URL redirection, not changing the status code.

Because of that, I don’t recommend using an undocumented filter as a production solution. I’ll need to check this internally/escalate it to confirm whether this 302 is expected and whether there is a safe way to apply a 301 only for translated WooCommerce product category canonical redirects.

I kindly ask you to share the access credentials to the site in your next message, which I have set private, so we can reproduce the issue and double-check the WPML configuration.

Looking forward to your message.
Regards,
Carlos

May 25, 2026 at 12:57 pm #18058092

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you for sharing the credentials requested.

I have escalated this ticket to our 2nd tier of support, where our specialists will take a deeper look at this behavior and will try to isolate its cause.

I will get back to you as soon as I get an answer from them.

Thank you very much for your patience and understanding!

May 27, 2026 at 11:51 am #18063445

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

Our 2nd-tier specialists are asking where these wrong links are coming from. Can you tell me?

May 27, 2026 at 1:42 pm #18063917

lobkeB

Hi Carlos,

Thank you for the update.

These URLs were not intentional internal links on our website. We originally found these wrong category URLs in the source code of the XML sitemap/hreflang output. We have now removed the incorrect sitemap hreflang output, because it contained wrong alternate URLs/slugs per domain.

We started investigating this because our WooCommerce product category pages are currently ranking poorly, so we checked possible technical SEO issues around WPML, hreflang, canonicals, sitemaps and redirects.

As part of that investigation, we tested translated WooCommerce product category slugs across our country domains using an external redirect/status code checker. The results consistently show a 302 redirect with the header `x-redirect-by: WPML`, followed by a 200 OK on the correct local category URL.

For example, if we manually enter a Dutch category slug on the Norwegian domain:

[hidden link)

WPML redirects it to:

[hidden link)

The redirect checker shows:

302 Found
x-redirect-by: WPML
→ 200 OK on the target URL

The same happens with German category slugs on the French or Dutch domain, for example:

[hidden link)
→ [hidden link)

[hidden link)
→ [hidden link)

So the issue is not that we are deliberately linking to these wrong URLs. The issue is that these wrong language/category slug combinations were present in the XML sitemap/hreflang output and are also accessible, where WPML handles them with a 302 redirect.

We are concerned because Google may have discovered these URLs through the XML sitemap/hreflang output, and may also remember them through old crawls, historic URL signals, image search, external links or manually tested/indexed URLs.

From our perspective, these URLs are not temporary alternatives. They are permanently wrong language slugs on the wrong country domain, so we would expect a 301 redirect to the correct local category URL.

Normal pages, shop pages and product pages appear to be handled by WordPress with 301 redirects. The 302 behavior seems specific to WooCommerce product category archives handled by WPML.

Could your 2nd-tier team please check whether this is expected behavior for WooCommerce product category translations, and whether there is a safe way to make only these category redirects 301 instead of 302?

Kind regards,

Lobke

May 28, 2026 at 8:16 am #18065564

lobkeB

Hi Carlos,

I would like to add one more piece of context for the 2nd-tier team.

We started investigating this issue because our category pages and images have dropped significantly in Google, especially in Google Images.

In Google Search Console, when filtering the Dutch property `hidden link` by:

Search type: Image
Period: last 6 months
Query: “verwarmde werkhandschoenen”

we can see that impressions and clicks for this image query dropped almost completely after around March 2026.

At the same time, when searching in Google Netherlands for the Dutch query “verwarmde werkhandschoenen”, one of our product images appears in Google Images, but Google shows the source URL as:

hidden link

This is a Norwegian domain with a Dutch category slug. That URL then redirects to the Norwegian category page:

hidden link

So Google seems to have discovered or remembered one of these wrong translated category slug URLs and is using it as the image source for a Dutch image search result.

I understand that this does not prove that the WPML 302 redirect is the only cause of the drop. However, it does show that these wrong category URLs are not only theoretical/manual test URLs. Google is actually using at least one of them in Google Images.

I will attach:

1. a Google Images screenshot showing the `heatperformance.no/verwarmde-handschoenen/` source URL;
2. a Google Search Console screenshot showing the drop for Image search performance.

Could you please share this with the 2nd-tier team as additional context?

Kind regards,

Lobke

Screenshot 2026-05-28 at 10.14.58.png
Screenshot 2026-05-28 at 09.59.40.jpg
May 28, 2026 at 9:57 am #18066020

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Lobke,
Thank you very much for the detailed explanation.

I have sent this new information to our 2nd tier of support for their analysis.

I will get back to you as soon as I get feedback from them.

May 28, 2026 at 12:08 pm #18066459

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Lobke,

We don't know the history that meant the sitemap contained the wrong links. We note that the product-category base is being stripped from the URLs, and we imagine it could be related to that.

The key is ensuring that the sitemaps are currently correct and the head link elements have the correct hreflang attributes (checking one of the example links, they do), and that there are no faulty internal links. If so, as Google re-indexes the site, it should fix issues with the wrong URLs.

The 302 redirects on these wrong URLs are a signal that Google should fix them, and it is true that a 301 redirect is a stronger signal, but these shouldn't be relevant if the available tools that prompt re-indexing are used.

In any case, some code could be added to clarify these redirects and change the status codes from 302 to 301, using the WordPress wp_redirect_status filter. It's not easy to target these redirects specifically, but this would apply to product categories with a redirect that will switch domains:

add_filter( 'wp_redirect_status', function ( $status, $location ) {
    if ( $status !== 302 || ! is_tax( 'product_cat' ) ) {
        return $status;
    }
    $to_host = wp_parse_url( $location, PHP_URL_HOST );
    if ( $to_host && $to_host !== ( $_SERVER['HTTP_HOST'] ?? '' ) ) {
        return 301;
    }
    return $status;
}, 10, 2 );

Please paste the above code in the functions.php file located in the active theme's folder.

May 28, 2026 at 12:43 pm #18066588

lobkeB

Hi Carlos,

Thank you for the explanation.

I have one question about the suggested snippet.

Most of the redirects we tested do not switch domains. They stay on the same country domain and only redirect from a wrong translated category slug to the correct local category slug.

For example:

hidden link
hidden link

and:

hidden link
hidden link

As I understand the snippet, it only changes the redirect to 301 when the target host is different from the current host:

$to_host !== $_SERVER['HTTP_HOST']

Would this snippet therefore still leave these same-domain product category redirects as 302?

Kind regards,

Lobke

May 29, 2026 at 9:22 am #18068844

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Lobke,

You are correct.

The snippet shared by our 2nd-tier team only changes the status code when the redirect target host differs from the current host:

$to_host !== $_SERVER['HTTP_HOST']

Therefore, redirects that remain on the same domain and only correct the translated product category slug would still return a 302.

The intention of the example was to provide a safer and more limited scope, affecting only cross-domain redirects. For same-domain product category canonical redirects, the snippet would need to be adjusted.

Would you like me to ask our 2nd-tier specialists for a broader solution? If so, please keep in mind that they will need to verify whether changing all WPML-generated product category canonical redirects from 302 to 301 is safe and whether there could be any side effects we should consider.

Kind regards,
Carlos

June 3, 2026 at 9:57 am #18078047

lobkeB

Hi Carlos,

Yes please, could you ask the 2nd-tier team for a broader solution?

The main issue for us is same-domain product category redirects, where only the translated slug changes, for example:

hidden link
hidden link

These are permanently wrong category URLs, so we would prefer a 301 instead of a 302.

Could they confirm whether it is safe to change only these WooCommerce product category redirects from 302 to 301, without affecting WPML language negotiation, hreflang, canonicals, language switchers or WooCommerce Multilingual?

Kind regards,
Lobke

June 3, 2026 at 10:14 am #18078111

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Lobke,

I have asked our 2nd-tier. I will get back to you as soon as I get an answer 🙂

June 4, 2026 at 10:02 am #18080992

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Lobke,
Thank you for your patience while I checked this with our second-tier team.

They have confirmed that changing these specific WooCommerce product category redirects from 302 to 301 will not affect WPML's language negotiation, hreflang tags, canonical URLs, language switchers, or WooCommerce Multilingual functionality.

In other words, those WPML and WooCommerce Multilingual features do not depend on whether these category redirects use a 302 or a 301 status code.

Therefore, for cases such as:

hidden link
hidden link

It is safe to use a **301 (permanent) redirect** if these are permanently changed category URLs and you want search engines to treat them as such.

Please let me know if you have any additional questions or if you would like us to review any specific redirect scenarios.

Kind regards,
Carlos

June 14, 2026 at 5:48 am #18101779

lobkeB

Hi Carlos,

Thank you, that is clear.

Is WPML/WooCommerce Multilingual planning to change this behavior in a future update, so these permanent category slug redirects use 301 by default?

If we provide a custom PHP snippet using the WordPress wp_redirect_status filter, could the second-tier team confirm whether the logic is safely scoped for this exact case?

Best regards,
Lobke