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 thread is resolved. Here is a description of the problem and solution.

Problem: In some cases, the post is redirected to the translation.

Solution:
We provided a fix in https://wpml.org/errata/redirect-loop-using-slug-different-posts/ but unfortunately, this was not working in your case.

In some cases, the issue is deeper. Please add the following snippet in your functions.php file:

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 );

Tagged: 

This topic contains 34 replies, has 8 voices.

Last updated by fabrizioL-4 3 years, 9 months ago.

Assigned support staff: Pierre.

Author Posts
December 9, 2015 at 8:04 pm #765206

Dirk

I am trying to: open original Dutch posts

URL of (my) website where problem appears: hidden link

I expected to see: hidden link

Instead, I got: hidden link

My issues started after updating WPML and WP (4.4). Since yesterday I cannot open my Dutch posts anymore. They are automatically redirected to the English version while all translations are set correctly and worked perfectly before.
The weird thing is that the issues are on some posts, not every.
I can't figure out what is happening. I deactivated my redirection plugin but no success.

December 9, 2015 at 8:37 pm #765242

bryana-3

Same issue here.

December 9, 2015 at 10:26 pm #765336

Dirk

Update... it seems I am not the only one with this problem. Just for your information :
I performed some steps under WPML > support advised by your staff in another topic :
- Cleared WPML cache
- Removed ghost entries from the tables
- Fixed element_type collation
- Set language information
I also played with the language URL format settings.
Absolutely nothing solves the problem 🙁

December 10, 2015 at 9:22 am #765583

Dirk

Another update while we are waiting for a solution...

I deleted the English translation and emptied the trash. After this the Dutch article shows correctly.
Then I recreated the English translation again from zero. Suddenly the Dutch article again redirects to the newly created English version.

Then I tried to deactivate WPML. When I do this the whole site messes up competely ! Yes, deactivating WPML makes everything even worse. Most articles suddenly show up in English only and widgets are disappearing. For your information, my site is set up with Dutch as original language.

I'm totally beaten here. This does not make sense. At this moment I am thinking of restoring an old backup.
You need to look into these problems very soon because sites are turning into chaos.

December 10, 2015 at 3:24 pm #766066

Eduard

Hi,

Do you have automatic browser redirects enabled?
You can check that from WPML->Languages->Browser language redirect section.
If so this will explains the behavior you are describing.

Thanks

December 10, 2015 at 5:36 pm #766232

Dirk

No, browser redirect is not enabled.
I've done some more testing. I duplicated my site to a staging environment and totally deactivated ALL non WPML plugins. I activated the standard twenty fifteen AND fourteen themes.
I deactivated Cloudflare and all my caching plugins on the server. Cleared all my browser caches and cookies.
Nothing helps ! Starting to feel a bit hopeless now 🙁

As I wrote before this issue does not affect all my articles. Let's say about half of them.

And before the update there were NO issues at all !

December 10, 2015 at 10:51 pm #766449

Dirk

Here's an update to my previous reply.
What I did next :
Step 1 - Replaced an old files and database backup with versions 4.3.1 of WordPress and 3.3.1 of WPML.
=> My site suddenly worked normal again with NO issues !
Step 2 - Updated my theme to latest version => still no issues
Step 3 - Updated WordPress to 4.4 => problem returned with still the old versions of WPML (3.3.1) running.
Conclusion : WPML is not totally compatible with WP 4.4. Updating to WPML 3.3.3 does not fix the problem.
For my site to run normal again I have to switch back to WP 4.3.1. This is not good.
I see there are more topics appearing here with similar problems. I hope you investigate the problem seriously.

I placed a copy of my site on a staging environment with NO plugins active (only WPML) and with the basic twenty fourteen theme activated. If you want you can study the problem there. Just let me know.

The basic question remains the same : why do some Dutch posts redirect to the English version automatically, and others don't ? No browser redirection active, just to be clear.

December 11, 2015 at 7:56 am #766590

Eduard

Hi,

If you can provide admin access and FTP credentials to test site that would be very helpful to further debug your issue.
You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Thanks

December 11, 2015 at 10:15 am #766756

Dirk

Normally you should have received the login details.

December 11, 2015 at 11:31 am #766843

Eduard

Hi,

Thanks for the details. I've past the first step, but on second I get error message that username or password are invalid.
Can you please double check them?
I'll mark your next reply as private.

Thanks

December 11, 2015 at 12:01 pm #766873

markusO-3

Hi, I experienced a similar problem. After upgrading to WP4.4 and WPML 3.3.3, one portfolio post created a redirect error (err_too_many_redirects). Upon this, suddenly all my translations were replaced with the original language again. I lost hours of translation work. I contacted the author of my theme, who checked and reverted that it is not a theme issue, but suspected WPML. Given a tight deadline, I converted the portfolio posts to pages and now everything seems to work again. Hope this is resolved soon as I have a number of multi-language sites, which use a portfolio. Regards Marc

December 11, 2015 at 12:18 pm #766892

misoG

I might be experiencing the same issue here:

https://wpml.org/forums/topic/cant-switch-back-to-using-wpmls-string-translation/

Can you check what setting is selected in your "WPML -> Theme and plugins localization" section?

Mine reverted back to "Don't use String Translation to translate the theme and plugins" and I can't switch it back, and now a lot of my FR translations are not showing any more.

December 11, 2015 at 12:26 pm #766903

markusO-3

Mine is also set at "Don't use...", but I am afraid of touching it at this stage...

December 11, 2015 at 12:30 pm #766905

misoG

I bet you can't switch it to the other setting either... even if you tried.

December 11, 2015 at 4:09 pm #767163

Eduard

Hi,

Is anything changed on your site because now hidden link is showing correct page and I can't reproduce that.

Thanks