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 1 reply, has 2 voices.

Last updated by Raja Mohammed 9 months ago.

Assigned support staff: Raja Mohammed.

Author Posts
September 2, 2019 at 8:57 am #4495531


I am trying to:

open hidden link

I expected to see:

Existing post:
hidden link

Instead, I got:

Redirect to page with same slug.
hidden link

From brief look-around, the issue is caused by method 'guess_cpt_by_name' in WPML_404_Guess class, where $type = $query->get('post_type'); in that case returns nothing (which is leading to setting default type - which in this scenario is page, not post).
However if I explain object $query and change it to $type = $query->queried_object->post_type; all seems to be working fine.

I'm not sure what the real cause is here, but I'm pretty sure the issue will come back right after update, so please have a look at that.

September 2, 2019 at 12:36 pm #4497081

Raja Mohammed

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello there,

I will help you with the issue.

Could you please confirm whether the issue persists when WPML is deactivated?
Is it happening only on a particular page or is there any other affected page.?

Please check if there is any redirect enabled in Yoast or any other plugin.

I would also request temporary access to your site so that I can have a closer look into the issue. I have enabled private fields for you to securely share the details.

Kind regards

The topic ‘[Closed] Incorrect redirects from Post to Page with same page_name’ is closed to new replies.