Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 -
- 13:00 – 15:00 13:00 – 15:00 13:00 – 15:00 13:00 – 15:00 13:00 – 15:00 -

Supporter timezone: Europe/Madrid (GMT+02:00)

Tagged: 

This topic contains 37 replies, has 0 voices.

Last updated by kamal-kishorS-2 15 hours, 53 minutes ago.

Assisted by: Carlos Rojas.

Author Posts
August 26, 2025 at 9:28 am #17347326

kamal-kishorS-2

Hi Carlos Rojas,

I have enabled the Debug but nothing capture in log file as WordPress’s WP_DEBUG_LOG only records PHP notices, warnings, and fatal errors. A normal 404 is just a template render (404.php), not a PHP error — so it will not be logged automatically. To capture 404 error too, i have added below to function.php
add_action( 'template_redirect', function() {
if ( is_404() ) {
error_log( '404 error: ' . $_SERVER['REQUEST_URI'] . ' | Referer: ' . ($_SERVER['HTTP_REFERER'] ?? 'none') );
}
});
I tried re-producing 404 error but still it doesn't record. Again i tried producing 404 error by entering wrong URL, the 404 theme template file fired and also recorded into log file.

[26-Aug-2025 09:19:36 UTC] 404 error: /application-verticals/adasdasas/ | Referer: none

I think, when i switch between languages, the cache might get “stuck” on the old URL, and when the request is made again, it cannot be found. As a result, the site falls back to Hostinger’s default 404 page instead of the 404 template from the theme.

Pls suggest.

August 26, 2025 at 9:30 am #17347331

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi Kamal,
Thank you for sharing your findings.

Please flush all cache memory and deactivate all cache plugins/functionalities. Then double-check if the issue has disappeared.

August 26, 2025 at 9:48 am #17347431

kamal-kishorS-2

Hi,
As informed, i have disable the CDN and not using any cache plugin. The issue still persist.

August 26, 2025 at 9:52 am #17347464

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi,

You mentioned "...the cache might get “stuck” on the old URL..." in your previous comment, that is the reason why I asked to clear the cache.

Can you test the site on a local server or on a different server and check if the issue persists?

Also, please check if the page slug matches an archive page slug or a post slug, which might cause the 404 errors too.

August 26, 2025 at 11:29 am #17348019

kamal-kishorS-2

Hi,
I have ported the entire site to another server and same issue on that server too.
I have checked the duplicate slug but didn't find any.
Can you pls check the issue on website as i have shared admin credential as well as FTP access

Regards,
Kamal

August 26, 2025 at 11:48 am #17348104

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi Kamal,

I have tested the Contact page and updated the translations; now I can see all the languages showing correctly. If you find the same 404 error in other pages, please follow these steps:
- Edit the page in the original language
- Make a small change in the content, like adding a final space to a paragraph
- Save the changes and update the translations
- Then double-check if the 404 has disappeared

August 26, 2025 at 11:52 am #17348114

kamal-kishorS-2

Hi Carlos,

I tried checking the contact page and again encounter 404 error.
hidden link

Screenshot 2025-08-26 at 5.20.16 PM.png
August 26, 2025 at 11:56 am #17348180

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi Kamal,

I can see the page loading correctly -see attached image-

FireShot Capture 153 - Dettagli di contatto dei fornitori di attrezzature di sicurezza di _ - [cyan-crow-394025.hostingersite.com].png
August 26, 2025 at 12:00 pm #17348197

kamal-kishorS-2

Hi Carlos,

Thats is the problem. Sometime, page open and sometime, it return 404. Try navigated 2-3 times switching between language for same page. you will encounter 404 error.

Screenshot 2025-08-26 at 5.28.42 PM.png
August 26, 2025 at 12:06 pm #17348220

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi Kamal,

You are right, after switching to the contact page in the original language hidden link the 404 appeared again. However, WPML plugins make no changes in the content of the original language, so this is not a translation problem.

I recommend you contact your hosting providers and ask them to check the logs on the server side to see if there is any information related to this behavior.

August 26, 2025 at 12:11 pm #17348250

kamal-kishorS-2

Hi Carlos,
There is not any issue with hosting provider. I have tested this with 3 hosting provider (Hostinger, SiteGroud & Rocket.net). If i switch to "Language name added as a parameter", it work smoothly. If i hide language pages, i don't see any 404 error. So the problem is with WPML and / or routing issue.

August 26, 2025 at 12:13 pm #17348266

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi Kamal,

We can't isolate the cause of a random issue; we need clear steps to reproduce it.

If you authorize me, I can deactivate all plugins, except the WPML ones, then activate a default WordPress theme and start checking from that minimal setup.

August 26, 2025 at 12:24 pm #17348276

Carlos Rojas
WPML Supporter since 03/2017

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

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

Also, I will need your confirmation that you have created a full site backup that you can restore if necessary.

August 26, 2025 at 12:54 pm #17348403

kamal-kishorS-2

Hi Carlos,

You can proceed to diagnose the case and if required, you can deactivate the plugins. I have taken the full backup of the site.

Regards,
Kamal

August 26, 2025 at 1:13 pm #17348503

Carlos Rojas
WPML Supporter since 03/2017

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

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

Thank you for your authorization.

I followed these steps:
- Deactivated all plugins, except the WPML ones
- Activated a default WordPress theme

The result was that the 404 error disappeared, which means that the cause of the issue is not the WPML plugins.

Then I activated the parent theme, then the child theme, and then some other major plugins, and the issue hasn't happened again.

Please continue activating the rest of the plugins, one by one, until the issue appears again and you find the culprit.