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

Last updated by Carlos Rojas 1 year, 9 months ago.

Assisted by: Carlos Rojas.

Author Posts
September 29, 2023 at 9:12 am #14486703

John Hobson

Tell us what you are trying to do?

The company are closing their foreign language versions of the site, so I have hidden these and they are now redirecting to the UK homepage.

However they are redirecting as 302 temporary redirections, but it is likely (but not absolutely certain) that this will be a permanent change. They have asked if it's possible to make these redirects 301 (permanent redirect).

Could you let me know if it's possible to do that.

I checked the docs and looked through settings but couldn't see anything for setting the redirect type.

The site is hidden link

Screenshot showing how the languages are set up on this site: hidden link

thanks

John

October 1, 2023 at 9:41 am #14492735

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi John,

I will add the first reply before this ticket is assigned to one of my colleagues.

WPML does not have any redirection preferences feature that can be used in this scenario.

We suggest that you search for a third-party solution such as the plugins listed below:

https://wpml.org/plugin-functionality/redirect/

Thanks

October 4, 2023 at 10:41 am #14511881

John Hobson

I had a look at the plugin and it doesn't appear to do what we need, that I can see anyway.

Is there a hook or filter in WPML that can be used to change the redirect type for disabled languages from 302 to 301?

thanks,
John

October 4, 2023 at 11:04 am #14512225

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hello,
My name is Carlos and I will continue working on this ticket

In this link, you will find our hooks list: https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/ with some hooks related to redirection. However, with the plugin mentioned by my colleague (or directly in the .htaccess file), you should be able to create a 301 redirection using a wildcard (*). Something like this should work: domain.com/es/*

Regards,
Carlos