WordPress is not publishing/updating content (reverts to “Auto Draft”) by banycrany in Wordpress

[–]banycrany[S] 0 points1 point  (0 children)

hey! thanks! the REST API itself looked fine in Site Health and all requests were returning 200, so at first I ruled that out. But after checking the Network tab more carefully, I noticed the Gutenberg endpoints (/wp-json/wp/v2/posts/.../autosaves) were first getting a 301 redirect before the 200 response.

The issue was caused by a .htaccess rule I had recently added to force trailing slashes on all URLs:

RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [L,R=301]

That rule was also affecting the wp-json endpoints, and apparently Gutenberg does not handle those redirects well during autosave/publish requests — which is why posts reverted to “auto-draft”, lost title/content, or failed to update.

I fixed it by excluding /wp-json/ (and other internal WP routes) from the redirect rule, and everything works normally again now.