• Resolved molcsa

    (@molcsa)


    Hi,

    I have a weird problem using Translatepress: if I try to create a new post/page or edit an existing, the post content doesn’t get saved. I checked the network requests using Chrome DevTools, and found that the REST API request for saving the posts (domain.com/wp-json/wp/v2/posts/3423?_locale=user and domain.com/wp-json/wp/v2/pages/3?_locale=user) gets 301 redirected.
    The redirect is like this: domain.com/wp-json/wp/v2/posts/3423?_locale=user (301, POST) -> domain.com/wp-json/wp/v2/posts/3423/?_locale=user -> (200, GET).
    Weird, that the POST request becomes a GET request after the redirect happens. Because of this the content is not saved in the database, and I can’t update or publish a post.
    If I turn off Translatepress, the POST request has 200 OK status code for the above URLs (so no redirect happens), and post content gets saved. Also found out, that if I set “Use a subdirectory for the default language” setting to No in Translatepress settings, the POST request also doesn’t get redirected, and the post content is saved.
    I’ve been using Translatepress for more than a month now without changing any setting (“Use a subdirectory for the default language” was also set to YES), and had no such problem. It started to happen from today without any clear reason. I tried to update WP to latest 5.9 version, didn’t solve the problem. I’m using latest Translatepress version (2.1.9).
    Could you please look after this issue?

    Thanks in advance,
    Csaba

    • This topic was modified 2 years, 2 months ago by molcsa.
  • The topic ‘Redirects REST API calls – unable to save post’ is closed to new replies.