Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing issues where your site defaults to English and does not switch back from Arabic correctly, the problem might be related to your site's configuration.
Solution:
We recommend checking your

wp-config.php

file for the following lines:

define( 'WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/' );
define( 'WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/' );

Please remove these lines and see if that resolves the issue. This adjustment should help in correctly switching the languages on your site.

Keep in mind that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.

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.

Tagged: 

This topic contains 18 replies, has 1 voice.

Last updated by minZ-2 1 week, 6 days ago.

Assisted by: Shekhar Bhandari.

Author Posts
March 13, 2026 at 6:59 am #17894301

minZ-2

The site defaults to English upon entry. Switching to Arabic displays correctly, but switching back to English still leaves the page in Arabic.

March 13, 2026 at 7:14 am #17894391

minZ-2

i still need help

March 13, 2026 at 7:18 am #17894425

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you on this issue.

Could you please go to WPML-> Support ->Troubleshooting and click the below buttons and see if it helps?

+ Clear Cache in WPML
+ Set Language information
+ Fix element types collation
+ Remove ghost entries from the translation tables
+ Assign translation status to duplicated content

If not, To debug this issue further, I would need to check your site settings once, for this I would need temporary access (wp-admin and ftp) to your site.

So could you please provide me with those details, you will find the needed fields for this below the comment area when you log in to leave your next reply.
hidden link

This info is private and available to you and WPML supporters only.
Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note:
Backup your sites before providing the credentials or if possible provide credentials for the test site

Look forward to your reply.

Thanks

March 13, 2026 at 7:39 am #17894507

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can I install a filemanager plugin and database plugin to check this further, hidden link is the main domain for your site?

Look forward to your reply.

Thanks

March 13, 2026 at 7:41 am #17894508

minZ-2

Did you spot the problem?

March 13, 2026 at 7:42 am #17894509

minZ-2

hidden link is not my domain; hidden link is. you can install the plugin

March 13, 2026 at 7:47 am #17894546

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Your database shows homeurl and siteurl incorrectly as hidden link, I will need your permissions to change this, please confirm once you have a fresh backup.

Thanks

March 13, 2026 at 7:51 am #17894552

minZ-2

hidden link is mapped from the domain hidden link. Will this cause any issues?

March 13, 2026 at 7:53 am #17894554

minZ-2

Please help me correct this. I have already completed the site backup.

March 13, 2026 at 7:56 am #17894559

minZ-2

Is the incorrect pointing of homeURL and site URL in the database the primary reason why the footer language switcher fails to function properly?

March 13, 2026 at 7:57 am #17894575

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I fixed the database to correct url.

I further checked and noticed that on your wp-config.php you have the following

define( 'WP_HOME', '<em><u>hidden link</u></em>' . $_SERVER['HTTP_HOST'] . '/' );
define( 'WP_SITEURL', '<em><u>hidden link</u></em>' . $_SERVER['HTTP_HOST'] . '/' );

Can you please remove it and see if it helps.

Thanks

March 13, 2026 at 8:03 am #17894581

minZ-2

Is there any progress?

March 13, 2026 at 8:04 am #17894598

minZ-2

I don't know how to delete it. Could you help me delete it?

March 13, 2026 at 8:07 am #17894600

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I don't have permissions for it. So you will need to make this changes yourself or provide me read/write access for wp-config.php

Thanks

March 13, 2026 at 8:08 am #17894601

minZ-2

Could you please comment it out instead of deleting it outright? Modify the code to:
/* define( ‘WP_HOME’, ‘hidden link . $_SERVER[‘HTTP_HOST’] . ‘/’ );
define( ‘WP_SITEURL’, ‘hidden link . $_SERVER[‘HTTP_HOST’] . ‘/’ );
*/