This thread is resolved. Here is a description of the problem and solution.
Problem:
You are experiencing an issue where you cannot save or edit translations due to an error message: 'Updating failed. The response is not a valid JSON response.' This problem is likely related to the reverse proxy settings on your live website.
Solution:
First, ensure you have a full backup of your site as the settings involved are sensitive. Then, follow these steps:
1. Add the following code to your theme's functions.php file:
function test_remove_homefilter() {<br />if (is_admin()) {<br />global $wp_filter;<br />if (isset($wp_filter['home_url']->callbacks[-10])) {<br />foreach ($wp_filter['home_url']->callbacks[-10] as $key => $value) {<br />if (str_contains($key, 'home_url_filter')) {<br />remove_filter('home_url', $key, -10);<br />}<br />}<br />}<br />}<br />}<br />add_action('admin_init', 'test_remove_homefilter');
2. If the issue persists, add the following rewrite rule to your server's configuration to correct the request paths:
location ~ ^/[a-z]{2}/wp-json/(.*) {<br /> rewrite ^/[a-z]{2}/wp-json/(.*) /wp-json/$1 permanent;<br />}
If these steps do not resolve the issue or if the solution seems outdated or not applicable to your 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.
This topic contains 3 replies, has 0 voices.
Last updated by 6 months, 2 weeks ago.
Assisted by: Lucas Vidal de Andrade.