[Resolved] REST API IS NOT WORKING WHEN I HAVE WPML ACTIVATED
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing server timeout issues, 502 errors, and the REST API is deactivated. These issues occur when WPML is activated. Deactivating WPML resolves the issues on the administrator side but breaks the site functionality. Solution: We identified that the 'auto_adjust_ids' setting in WPML might be causing the issue. We recommend disabling this setting to potentially resolve the problem. For more details on how this setting can affect site performance, please visit https://wpml.org/forums/topic/performance-issue-with-wpml-7/#post-15300762.
If this solution does not apply to your case, or if it seems outdated, 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 issues persist, please open a new support ticket at WPML support forum for further assistance.
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.
<b>Background of the issue: </b>
For a few days now we have been experiencing timeout issues and different errors on the server. At first we thought it was a server problem, but we have even tripled the resources to have dedicated resources. Although the site is now loading, we have not stopped having 502 errors and a very large one that makes the REST API not work, it is disabled. Among all the tests we have done, turning off and on all the plugins, one by one, in the end the result is always that, by deactivating WPML, the website works well, at least on the administrator side, because clearly deactivating WPML causes the site to break.
We have tried everything, but we were unable to solve it. Today we contacted elementor support for assistance, and the only thing they were able to tell us was that there was a problem with WPML, but they could not figure out which one.
I have seen in the forum that there are different tickets related to the rest api, but not one like ours. Could you help us?
hidden link
<b>Symptoms: </b>
Elementor not loading, REST API deactivated, 502 error..
Thank you for contacting the support. Meanwhile this ticket is attended by one of my colleagues, the REST API is a crucial software that enables two applications to exchange data using a specific set of constraints. In particular, the WordPress REST API enables you to connect your WordPress website with external applications (like our services).
If you verify that the REST API is indeed disabled, it should be activated back at the server level - unfortunately, it cannot be done through the WordPress dashboard. So you'll need to get in touch with your hosting provider and ask them to enable it for you.
Sometimes the message on WPML -> Support saying that the REST API is disabled is just a false positive. Please follow the tutorial described on this link and check if it is really inactive on your website: hidden link.
You may also need to whitelist the following domains:
- wpml.org
- cdn.wpml.org
- api.wpml.org
- api.toolset.com
- cloudfront.net
All in all, if REST API is enabled and you're still running into these issues, I'll recommend checking with only WPML plugins and a default WordPress theme like 2021 or 2024, so we can see if issue is really coming from WPML and if it can be reproduced in a minimal setup. If that works fine, then start activating other plugins one by one while keep checking for the issue, so you can pinpoint when it starts happening.
IMPORTANT: Please take full backup of your website and database beforehand.
It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.
Please let us know your findings and we'll try our best to help you further on the matter.
We just literally changed the server because this error. In our new server we have direct contact with someone of support team, they ran a test and figure out that is this process which is consuming all the recourses. Any ideas how we can solve this? As i said before, if i turn of wpml, everything goes well, if i just let wpml on and nothing else, goes wrong again.