Skip Navigation

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 5 replies, has 0 voices.

Last updated by Bobby 6 days, 16 hours ago.

Assisted by: Bobby.

Author Posts
April 16, 2025 at 8:03 pm #16941122

Miro

Hi Bobby,

your solution was excellent! It seems it all works, which is just superb. In the past, we just could not get past those updates without a crash. So, kudos to you - thanks!

However, sadly, new issue occured - in the past our product translations worked correctly, and now they do not, giving "Too many redirects" error.

I have troubleshooted this for 5+ hours today to not waste support time. The issue is totally similar, word for word to this one:

https://wpml.org/forums/topic/product-url-changes-incorrectly-on-secondary-language-too-many-redirects-error-2/

However the proposed solution works only partially.

I want to be respectful of this ticket and your time, so I would not include details here, but I will do so if you agree, of course.

I have replied to that thread, too, since they were already dealing with that there. Here is link to my reply:

https://wpml.org/forums/topic/product-url-changes-incorrectly-on-secondary-language-too-many-redirects-error-2/#post-16936216

Again, I understand cross-topic tickets are not best for anyone, but I thought I would ask anyway, since we have already built rapport together and you helped us.

Thank you for your help and please let me know how to proceed.

April 16, 2025 at 8:03 pm #16941123

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

April 24, 2025 at 6:29 am #16962561

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi Miro,

Thank you for the access details!

If possible, please sahre with me a product or two that I can reproduce this issue with, I did try with a few and I was not able to therefore I am assuming I am just not picking the right ones to test with.

April 24, 2025 at 12:35 pm #16964394

Miro

Hi Bobby,

Of course! Thank you for your help!

First let me share a product which works well (but I presume you also found those that work):

original
hidden link

EN version + DE version:
hidden link
hidden link

And now products which do not work since they are not translated/duplicated:

It, of course, works in the base/default language:
hidden link

But does not work in EN:
hidden link
Also please note that at first, the URL is this:
hidden link
but it gets “redirected” to the one that does not work:
hidden link
And errors out with “too many redirects”

Neither does it work for DE:
hidden link
Again, at first it is:
hidden link
Which gets redirected to:
hidden link
And errors out with “too many redirects”

Also., the “redirect” is done on production site, too:
hidden link
this, when changed to EN version (eg. via the country flag in the menu), gets first to the same URL structure as on staging site:
hidden link
Which then redirects to:
hidden link
But DOES NOT error out with “too many redirects” - it works just fine.

BUT BREAKTHROUGH:
I have just discovered, as I was copypasting more products with the error for you, that SOME indeed work just fine, even without being translated!

In the previous days, I have tried hard and not a single product I chose that did not have translation, worked.
But the client told me it works fine for him (not the same products, just that he tried about two dozen of them).

I thought he just picked the ones that were translated by mistake. And I could still not find a single product, that was not translated and not give the error.

Now I found a couple that work, regardless of translation. That is weird.

Eg. those should not work, but they do:
hidden link
hidden link

So we might be looking at some weird issue… could this be taxonomy sync or something?

Again, in production on older version of WPML - everything just works, all products. So the update DID introduce the bug, but which one exactly?

Please let me know if I did not write it too confusingly, and how can I help so we can pinpoint this down together.

Again, thank you for your time and dedication!

April 25, 2025 at 6:39 pm #16969712

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Thank you for writing all this information out, and I believe I clearly understood 🙂

One thing that could greatly help us here is to run a redirect check.

For this URL for example:
hidden link

Go to hidden link and analyse it.

When I tried it gave me a 401 not allowed error, possibly you could temporarily lift the ban on bots crawling the site?

Getting a redirect report it will help.

Also, I wonder if this is being caused due to the permalinks.

Has anything changed regarding the permalinks and their translations?

April 26, 2025 at 6:08 pm #16971402

Miro

Hi there,

thank you for trying the redirect check, Bobby!

I have disabled the HTTP auth and here are the results for the URL you have posted:

START

Result
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently
hidden link
301 Moved Permanently

Problems found:
Too many redirects. Please try to reduce your number of redirects for hidden link. Actually you use 19 Redirects. Ideally you should not use more than 3 Redirects in a redirect chain. More than 3 redirections will produce unnecessary load on your server and reduces speed, which ends up in bad user experience.

END

I can also send you the HTTP headers info, but it seems to be similar to the previous. Just please let me know in which format, as the file is very long and I don´t want to spam it here. 🙂

I could upload it as an image, but that would still be I guess tedious and not practical when working with text.

I have again turned ON the HTTP auth, but please let me know if you would like me to turn it off and I will do so ASAP.

***

Also you have asked:

Also, I wonder if this is being caused due to the permalinks.

Has anything changed regarding the permalinks and their translations?

***

My answer:

Nothing that I am aware of - I have also compared permalink structure between production (still on old WPML version) and this staging site, and they correspond.

I have also of course cleared all the caches:
- WPML cache,
- Litespeed cache,
- saved permalinks again to "flush" them,
- etc.

But please let me know if I can asist in any way - I can also create the SFTP if that would help.

Thank you so much for not giving up on this. 🙂
Miro

April 27, 2025 at 2:46 pm #16972436

Miro

ps: Bobby, I have also discovered WPML error message that might give clue to this:

***

Some taxonomy terms are out of sync between languages. This means that content in some languages will not have the correct tags or categories.

In order to synchronize the taxonomies, you need to go over each of them from the following list and click the "Update taxonomy hierarchy" button.

***

However upon checking it, it does seem okay, but maybe I am wrong - could you please take a look? I realize you are not WP site support, but I am not sure how this WPML feature works exactly... the error page can be found here:

hidden link

Again, thank you for your time and help!

April 28, 2025 at 4:19 pm #16975799

Miro

pps: I have tried the "Synchronize taxonomies" fix (it was just for 2 of them), also clicked the "Synchronize Product categories assignment in content", but still no change.

I was hoping this might somehow be the fix, but sadly, no dice.

April 28, 2025 at 6:36 pm #16976534

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for sharing the above information!

Yes, as I expected -- this will do it and trigger the ERR.

If possible please deactivate the HTTP auth and I will do a quick check from my side as I am looking for a specific information 🙂 Once I am finished I will let you know so you can turn it on right away.

April 28, 2025 at 6:49 pm #16976548

Miro

Of course, Bobby, I have disabled the HTTP auth. 🙂

Fingers crossed and please let me know if I can help in any way!

Thank you.

April 29, 2025 at 9:18 am #16977863

Miro

ps: I also have an idea - we COULD simplify the product permalink structure. Sure, SEO implications and all that - but the site will get redesigned anyway and change some URLs and so forth, so it will not be that big a deal, especially if I remap search engines.

So, what do you think, Bobby, is this something we should try, or is that totally unrelated?

Also, FIY, I am using the fix from the similar thread, which did not help (or hurt) anything - but can it be actually making things worse now?

I mean this code from this thread (https://wpml.org/forums/topic/product-url-changes-incorrectly-on-secondary-language-too-many-redirects-error-2):

add_filter( 'wc_product_post_type_link_product_cat', 'custom_modify_product_cat', 10, 3 );

function custom_modify_product_cat( $primary_term, $terms, $post ) {
// Example: Replace the primary term if the product has a specific category
if ( $post->post_type === 'product' ) {
foreach ( $terms as $term ) {
$termid = apply_filters( 'wpml_object_id', $term->term_id, $term->taxonomy, TRUE );
$term = get_term( $termid, $term->taxonomy );
return $term;
}
}
return $primary_term;
}

I am just including this info to make you less troubleshooting, so you know as much as possible. Of course let me know if that is redundant so I don´t confuse the thread.

April 29, 2025 at 10:36 am #16978442

Miro

pps (hope you don´t feel pressured, I just am adding helpful details, Bobby):

I have done the same big update for our other sister site and the results are much better there - it seems the redirect problem DOES NOT EXIST there!

a)
The thing is, we have been translating products on this site from the begining, so there were no missing translations AFAIK.

b)
We also have much simpler permalinks there.

c)
We have just one extra language apart from the native one - so Czech (native) and English (secondary).

d)
Other than that, though, the configuration is very, very similar with only the slightest differences (different product filter - sure, but that does not impose permalinks on translated products - or does it?). The site is redesigned, but using the same template and very little custom code that could change anything like permalinks - just design.

***

You can see the examples of 100% working translations here (the HTTP auth user and password are exactly the same):

original version:
hidden link

translated (EN) version:
hidden link

Again, if too much info, just let me know, but I thought it might be helpful.
If you want, I can create you a user there, too, of course.

Thank you, Bobby!

April 29, 2025 at 6:33 pm #16980735

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you, I was able to capture it.

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------

Status: 301 Moved Permanently
Code: 301
Date: Tue, 29 Apr 2025 18:30:50 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
X-Dns-Prefetch-Control: on
X-Redirect-By: WordPress
Location: hidden link
X-Litespeed-Cache-Control: public,max-age=604800
X-Litespeed-Tag: b88_product,b88_URL.6fa654b97707cf80088b8d3510b2cad6,b88_Po.141959,b88_
X-Litespeed-Cache: miss
Server: cloudflare
X-Turbo-Charged-By: LiteSpeed
Cf-Cache-Status: DYNAMIC
Set-Cookie: _lscache_vary=c8efe4c47e912f0ca683f46572f3af40; HttpOnly; Secure; Path=/; Max-Age=172800; Expires=Thu, 01 May 2025 18:30:50 GMT
CF-RAY: 9380df74de23d9db-FRA
alt-svc: h3=":443"; ma=86400

It looks like WordPress is having some hand in this redirection -- I will investigate further and update you.

Thank you for the additional information, it definitely helps. I can start debugging now and will let you know my results.

April 30, 2025 at 6:40 pm #16985148

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I found that the product Krokoit (with the URL krokoit-5) was not translated to the secondary languages.

In theory that should not cause any issues as you have the settings set for products to fallback to the default language.

Duplicating the page to English has resolved the Redirect issue for this URL now:
hidden link

The other product that is working OK, when I review it I can see that it's already duplicated.
hidden link

May 7, 2025 at 4:08 pm #17007767

Miro

Hi, Bobby,

thank you for the investigation!

I am not sure if I understand - you have said:

"It looks like WordPress is having some hand in this redirection -- I will investigate further and update you."

Then you tested the untranslated Krokoit and it did not work (despite the fallback, exactly as you have mentioned 👍).

Duplicating it DID solve the issue, just like we both found out.

The other product IS working alright, because it was already duplicated - and here I am not sure about what did you have in mind:
- Do you mean it should not have been working, but for some reason, is?
- Does the WordPress redirection as you have mentioned in previous reply, have anything to do with this?

Regardless if I did get it right or not - is there any proposed solution to the redirect issue, other than duplicating the 9000 products to solve it?

Thank you again for your time and help with this. 🙂