Why does REST API create posts in wp_posts with the content of the response?!
-
OK, I have a REST endpoint at myapp/v1/mydata which, without going into detail, returns some JSON data from a plugin of my own making (to be retrieved by the front end via AJAX) and it has all worked fine for over a year.
However, I have JUST discovered that posts are being created for each response (or maybe not EACH – some) in wp_posts. Like in this screenshot: https://i.imgur.com/G7qJvIv.png
The post_content is the JSON data, i.e.my API response, and the post_name is derived from the name of the endpoint.
It looks like some sort of caching, but I understood that REST API responses are not automatically cached. Without delving too much, does anyone have the remotest idea why it would be doing that? I have tens of thousands of posts I don’t need in my wp_posts table…
- The topic ‘Why does REST API create posts in wp_posts with the content of the response?!’ is closed to new replies.