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.

Tagged: 

This topic contains 7 replies, has 2 voices.

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

Assisted by: Carlos Rojas.

Author Posts
August 19, 2023 at 4:43 pm #14256781

Xevi Baena Ortigosa

Some translated pages spit out a 404 error. However this 404 errors are not real, because when you refresh the page it is loaded correctly.

I found out that the issue is caused becasue of a conflict with Yoast SEO plugin. Our Google Analytics account is saying us that the most seen page in the last 4 days is the 404 page. 20% of all the pages the users see are a 404 not found error, so the situation is pretty critical. I have created a dev copy of the site, been testing the site on hidden link and found out that when YOAST is deactivated the problem dissapears totally and the site is perfectly functional again.

Also, another problem I found is that sometimes the strings on WPML String Translations associated with Yoast change the language automatically without our interevention. This happens for the breadcrumbs strings. So for example you visit the page in french, and the breadcrumbs are in german. Or you visit in english and breadcrumbs are in italian. When you go to String translation to correct it, the strings associated with the breadcrumbs appear as "Need Update", so there's something overwriting them in the background. This issue might be related with the compatibility issue with WPML and YOAST that is also causing these fake 404.

Link to a page where the issue can be seen:
You can go to the directory here hidden link open a few listings there (beaches, ATM's...) and then try the language switcher for all the languages of this listing. I am pretty sure that at least one or two languages will lead to a 404 page. This 404 is not real, becasue if you refresh the page one or two times, then the page loads correctly.

The site is updated to latest version at the moment. If you need access to the DEV site to test I can give it to you too. We spoke with the hosting and they can't help and we are quite lost about how to solve this problem.

August 21, 2023 at 8:50 am #14261179

Carlos Rojas
Supporter

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

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

Hello,
Thank you for contacting us

1.- The issue of the 404 errors doesn't seem to be related to WPML plugins, because, as you described, when you deactivate the Yoast SEO plugin the errors stop. If you think this error is related to WPML please elaborate a little more so I can have a better understanding.

2.- Regarding the breadcrumbs: there was a bug that was solved in the latest release of the WPML SEO plugin and you can read more about on this errata page: https://wpml.org/errata/yoast-seo-on-breadcrumb-post-category-links-to-the-wrong-language/

Regards,
Carlos

August 21, 2023 at 5:56 pm #14266313

Xevi Baena Ortigosa

Hello Carlos,

I kept on making tests and is not Yoast but WPML String Translation or WPML SEO plugins while translating the strings from Yoast SEO that cause the conflict. At the moment, in the test site, Yoast SEO is active and working, and can switch along all the different languages without problem and without alerts in the inspection window from Google Chrome.

What did I do to achieve a functional site again? I deleted all the strings from Yoast from String Translation plugin so it is cleared, and also deactivated WPML SEO. You can now navigate through the different Listings of the site with no 404 errors appearing. You can test yourself visiting hidden link opening a few listings in spanish (default language) and then opening all the translations of it

Regarding the breadcrumbs error that you mention in point -2, I have the latest release of WPML Seo where this bug was solved. However, I never had problems with the links, it is a problem with the translated strings changing the language randomly. I attach a screenshot of this problem: as you can see, when going to the breadcrumbs screen in Yoast options, the breadcrumbs fields were one in english and another one in german (when in reality we introduced them in spanish, since it is the default language). When looking up for these same strings inside WPML String Translation they where with the (!) symbol (meaning that the translation needed an update, but we didn't really change anything).

Screenshot_7.jpg
August 22, 2023 at 8:09 am #14268665

Carlos Rojas
Supporter

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

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

Hi,
Thank you for your message

Could you describe, step by step, how to reproduce the issue on the site? (Not how to see it, but how to reproduce it) because we need to understand the issue and how to reproduce it at will at a site to be able to isolate its cause.

August 24, 2023 at 10:28 am #14283991

Xevi Baena Ortigosa

Hello Carlos, sorry for my late reply.
The 404's still are there. The only way of making the site work is deactivating WPML String Translation. With WPML String Translation plugin deactivated, the language switcher disappears, but I still can visit the translated URL's checking the page code doing a Ctrl+U and visiting the alternate links for every language that are inserted in the header. Then yes, the pages load correctly.
Also I noticed that the XML sitemap generated by Yoast is not showing the correct URL's for the translated languages: the directory (/de/, /en/...) of the language does not appear in the sitemap and the site makes a redirection or 404 randomly. I would like to keep on testing everything around.
The site is buildt on Elementor Pro, with a CPT and ACF fields everything managed through ACF Pro itself.
Question: is there a way to reset WPML and/or String translation plugins without losing translations on the way so I can see if after resetting and activating again, this solves the problem? I was checking this documentation here https://wpml.org/documentation/getting-started-guide/language-setup/deleting-languages-and-plugin-data-by-doing-a-wpml-reset-on-your-site/ but I would like to confirm first. I will try also doing a reset of the Yoast plugin and see what happens. The hosting company makes a back-up every hour, so we can mess with the test site as much as we want with no problem. Thanks a lot for your help.

August 24, 2023 at 10:40 am #14284155

Carlos Rojas
Supporter

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

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

Hi there,
Thank you for your feedback

I would like to ask you to follow these steps in order to isolate the cause of the issue:
- Create a full backup of the site
- Update any outdated plugins or themes
- Flush any cache memory that might exist
- Deactivate all plugins, including the WPML ones
- Activate a default WordPress theme, like Twenty Twenty
- Activate the WPML plugins
- If the issue disappears, start by activating the theme and then the rest of the plugins, one by one, until the issue appears again and you find the culprit.

Could you tell me the results of the steps described above?

August 24, 2023 at 1:19 pm #14285927

Xevi Baena Ortigosa

Hello Carlos, thanks for your help and following up with this issue. I spent days beind this issue... I isolated the conflict like you suggested to find the problem and yes, the problem came from Yoast SEO. The tables from Yoast SEO were not updated, so this was causing issues around the different meta elements of the plugin and its translations. This plugin https://wordpress.org/plugins/yoast-test-helper/ literally saved my day. I resetted the indexables, mirgations, prominent words, re-run the first-time configuration and all the data was freshly updated and no 404's appeared around translations anymore. As a suggestion for other users, I would highly recommend to add that little plugin into WPML documentation when people has problems with Yoast so they are able to reset the plugin without losing data. More information about the plugin here hidden link and here hidden link
Regards,

August 24, 2023 at 1:26 pm #14285969

Carlos Rojas
Supporter

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

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

Hi there,

I'm glad to hear that the issue is solved 🙂

Please don't hesitate to contact us if you need our help in the future with WPML. We will be more than happy to help.
Best regards,
Carlos