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 8 replies, has 2 voices.

Last updated by Yvette 9 months, 1 week ago.

Assigned support staff: Yvette.

Author Posts
August 9, 2019 at 11:43 am #4369885


The following URL produces an invalid redirect by WPML: hidden link. It redirects to hidden link, which is a non-existing URL.

I'm guessing it's because there is a post with the same name, but without the '-2' in the URL: hidden link.

The reason I know it's WPML, is because I'm checking who is redirecting at that page with the following lines of PHP:

if (isset($_GET['asdfajksldfs'])) {
    add_filter('wp_redirect', function($location, $status) {
        $e = new \Exception();
        echo '<pre>';

    }, 10, 2);

(You can try if you like by going to hidden link).

The displayed stacktrace indicates the redirect is issued by WPML. The steps 4 through 6 show WPML executing a wp_safe_redirect() function call.

When WPML is disabled, the issue does not persist.

Please advise.

August 9, 2019 at 1:48 pm #4370955


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

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


Could I take a look at this redirect from your dashboard?

Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

August 12, 2019 at 1:51 pm #4381445


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

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


I found a redirect in YOAST SEO redirects that caused this. (see image)
After eliminating it, the URL no longer redirects.

Can you confirm on your side?

August 16, 2019 at 11:33 am #4406097


Hi Yvette,

Thank you for your response. Unfortunately I cannot find the redirect you are pointing to. Moreover, I have removed all redirects that even remotely look like the URL in question, but the issue still persists. The permalinks have also been flushed, but this did have not any effect.

Please be aware that the stacktrace indicates the redirect is coming from WPML, as you can see when viewing this URL: hidden link (trace 4, 5 and 6).

August 19, 2019 at 10:02 am #4415025


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

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


You wrote:
" Unfortunately I cannot find the redirect you are pointing to..."

That´s because I removed it (see my last message to you).

Right now, I did the following steps and now no longer can get a redirection of the page you mentioned using icongito mode:

1. Enter hidden link ( I got redirected)
2. Go to hidden link
3. Deactivate SEO Yoast Premium
4. Activate SEO Yoast Premium
5. Visit in icognito mode: hidden link
I do not get redirected

WPML will not do any redirections. You may have been redirected due to YOAST caching or transient data (??).

Can you please try these steps yourself

August 21, 2019 at 7:31 am #4428455


Please read my initial question, because you are 'fixing' the wrong URL. I have clearly stated that the broken URL is hidden link, NOT hidden link.

You say WPML will not do any redirections, but have you even viewed the stacktrace? Or the sourcefile in WPML, because it contains this:

$this->sitepress->get_wp_api()->wp_safe_redirect( $redir_target, 301 );

Now please explain to me how WPML will not do any redirections.

August 21, 2019 at 9:18 am #4429371


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

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

Ok - my apologies for not noticing the URL.
This seems to be an anomaly that I cannot reproduce and assoicated with this particular slug.

When I change the slug from "john-deere-4520-2" to "2-john-deere-4520", the permalink rewrite does not happen.
Or changing "john-deere-4520-2" to "john-deere-4520-old"

I even created a new post and gave it this slug....then the same problem happened on this brand new post.

Conclusion: as long as the slug is not "john-deere-4520-2", you don´t get this strange behaviour.

In case you think that this is a compatibility issue, I also tested by cloning another existing post type: SuperScooper. I was unable to replicate the problem. I also tried with a normal post type: WPML.

So, I don´t know what to say but that this particular slug is corrupt somewhere in the database. Do you feel we need to investigate further?


August 21, 2019 at 10:13 am #4429847


Nevermind, I figured it out myself.

When asking for access to the server, I'm kind of expecting you actually know how to debug an issue. Simply dicking around in the admin screens does not help anybody when the issue is clearly technical.

Also, your conclusion is just absurd. Did you actually expect me to settle for it? It does not fix anything.

August 21, 2019 at 10:25 am #4430129


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

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

Ok. No need to be rude.

If you settled your issue, you can close this ticket and then leave a feedback to display your dissatisfaction.

If you are so inclined, you can also feel free to share your solution for others to see.

Our management sees all the reviews as does the general public so you can "shame" me which might be more effective than insulting or using vulgar language. In the end it just makes you look bad.

Have a great day.