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.

Our next available supporter will start replying to tickets in about 5.53 hours from now. Thank you for your understanding.

This topic contains 6 replies, has 2 voices.

Last updated by Robert 4 years, 8 months ago.

Assigned support staff: Mladen Andrejic.

Author Posts
January 3, 2016 at 7:50 am #779618

Robert

Hi,

When I open /product/pressure-vacuum-gauges/ from the product overview page it returns the redirect loop error and changes the url into chanpin/pressure-vacuum-gauges/
chanpin is the translation of product(in string translation).

Now strange thing is for all products seem to work fine except for 5 (out of 70). The only difference for those 5 products is they don't have a SKU set. Could be coincidence or not?

This error could have been a result of updating woocommerce multilanguage plugin but I'm not 100% sure.

I have:
- Tried saving settings>permalinks.
- I removed the .htaccess and created a new one.
- Disabled all plugins
- Changed themes

all without result

Any ideas what can cause this?

Thanks!

January 4, 2016 at 9:43 am #779950

Mladen Andrejic

Hello,

Can you please check the errata page we have for that problem that appears to be the problem with WordPress and see if this helps :

https://wpml.org/errata/redirect-loop-using-slug-different-posts/

Thanks.

January 4, 2016 at 10:09 am #779981

Robert

Hi Mladen,

It does seem to describe the problem, although no luck inserting that code in functions.php.
The English version seems to loop only. The Chinese (second language) product opens fine.

Thanks

January 4, 2016 at 11:52 am #780090

Mladen Andrejic

Hello,

Can you in this case just resave the post and see if it helps?

Thanks.

January 4, 2016 at 2:24 pm #780243

Robert

No luck. It's a product, not a post in case that matters.
Thanks!

January 4, 2016 at 2:50 pm #780265

Mladen Andrejic

Hello,

There is another workaround for this that should resolve the issue, just add this part of code to functions.php file of your theme :

// WPML fix: https://wpml.org/forums/topic/main-langage-posts-are-redirected-to-another-langage-not-all-posts/
function fix_35012_wp_old_slug() { 
    global $wp_query;
 
    if ( $wp_query->post_count > 0 ) {
        remove_action( 'template_redirect',  'wp_old_slug_redirect' );
    }
}
add_action( 'template_redirect', 'fix_35012_wp_old_slug', 5 );

Thanks.

January 5, 2016 at 1:34 am #780713

Robert

You're a legend! Works like a charm.

Thanks!