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 |
---|---|---|---|---|---|---|
10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | - | - |
16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | - | - |
Supporter timezone: Asia/Jerusalem (GMT+03:00)
Tagged: Documentation request, Not WPML issue
This topic contains 8 replies, has 1 voice.
Last updated by Alexander 3 hours, 3 minutes ago.
Assisted by: Itamar.
Author | Posts |
---|---|
July 9, 2025 at 8:58 am #17217694 | |
Alexander |
Background of the issue: Symptoms: Questions: |
July 12, 2025 at 12:46 pm #17230208 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Thanks for the details — this behavior is likely caused by a residual user language setting in their WordPress profile. Even though German has been removed in WPML, some users may still have it set as their preferred admin language, which causes WordPress to build the logout URL with /de/. To resolve this, please ask the affected user to: Go to their WordPress profile (/wp-admin/profile.php) Change the language setting to English Additionally, it's a good idea to refresh rewrite rules by navigating to Settings → Permalinks and clicking Save Changes. This helps clear any lingering path rewrites that might still reference /de/. These two steps usually reset how the logout link is generated and should eliminate the /de/ prefix. If those steps do not solve the issue, please let us know. Best regards |
July 14, 2025 at 7:04 am #17231753 | |
Alexander |
Refreshing rewrite rules doesn't help. If you access the /de/ path, it no longer exists in the rewrite rules, because the language was removed. The problem is the following code. WPML does not check whether the language someone has selected in the user profile still exists and always adds the locale prefix to the logout URL. It's not uncommon for someone to use WordPress in their language, even though that language isn't even offered on the website via WPML. sitepress-multilingual-cms\classes\url-handling\wpml-wp-login-url-converter.php: public function convert_user_logout_url( $url ) { As you can see, the locale is read from the profile, translated into the prefix using the icl_languages table, and added to the logout link. A check must be integrated here to determine whether the language is still active, otherwise the rewrite rule for the prefix will no longer be active and the logout link leads to a 404 error. |
July 15, 2025 at 8:40 pm #17239735 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, I'll continue to help you with this issue. Could you please outline the steps I should take to replicate this issue? Thanks, |
July 16, 2025 at 7:51 am #17240350 | |
Alexander |
Steps: 1. Login to the WordPress backend 2. Go to your user profile: /wp-admin/profile.php 3. Change the "Language" to a language, that is not enabled in WPML, for example Spanish. 4. Open the black WordPress toolbar menu in the top right corner where it says "Welcome/Hola <Your name>" and then click the bottom logout link ("Salir" in Spanish) in the dropdown menu. The link contains the language prefix of the user-specific language. In this example, /es for Spanish: 5. Because this language is not activated in WPML, the logout link leads to a 404 page because the language prefix was not registered in the WordPress rewrite rules. The solution is to check whether the current backend user language is enabled in WPML. Otherwise, the language prefix cannot be added in the following WPML function: function convert_user_logout_url() (Path of file: sitepress-multilingual-cms\classes\url-handling\wpml-wp-login-url-converter.php) |
July 17, 2025 at 4:19 pm #17247128 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Thanks for providing the detailed steps. However, I'm unable to replicate this problem on a fresh WordPress installation with WPML. When I click the log out link, I get logged out, and I don't get a 404 page. Please see a video I recorded here: Regards, |
July 17, 2025 at 6:22 pm #17247560 | |
Alexander |
I noticed that in the sandbox, no /es/ was written before the logout link. This was probably because no translated content existed yet. I added a page and translated it, and then /es/ was added as well. But the logout still worked. Does it do this automatically for every language a user has selected in their profile? Then there should also be an entry for Spanish in the sandbox, right? If so, that would be the reason when a system doesn't have write access to the htaccess. Then the call to a language specific logout fails. I'll test this thoroughly again tomorrow. Thanks for the help! |
July 20, 2025 at 8:44 am #17252784 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Yes, it should also work with Spanish, as you can see on the provided sandbox site. Please proceed with the suggestion to try this case in a minimal environment (as was suggested in the errata page), and let us know if you require further assistance with this issue. Regards, |
July 21, 2025 at 7:50 am #17253963 | |
Alexander |
Please re-enter your sandbox. I changed the user language to Portuguese, and now when you use the logout link in the top right corner of the menu, you get a "File not found" error, not even a designed 404 page like on my sites. I also have this problem on minimal installations. Logout-Link looks like this: hidden link I checked whether WPML creates real rewrite rules to redirect the /<language-prefix>/wp-login.php links. I couldn't find any entries. Only in the htaccess, but not for all languages. Actually, only the enabled WPML languages. Why Spanish works in the sandbox is a mystery to me! But Portuguese doesn't! So it would be really important that only the enabled WPML languages are supported in the "convert_user_logout_url" function. |