• I’m experimenting with using the REST API to make bulk content changes to my site. My intention is to send data (JSON format) to a custom endpoint and process all of it.

    But the custom endpoint documentation implies that endpoints are intended for creating/updating single posts. (I’m referring to the PUT method.)

    Am I reading that right?
    Is there a different/better way to push changes en masse?

    The big concern is that I’m looking at a ton of updates. I’d rather push a big chunk of JSON data all at once than make thousands of tiny requests.

    Thanks for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator threadi

    (@threadi)

    When you create a custom endpoint, it is entirely up to you how you receive and process the incoming data. You could also create an endpoint that you give 100 object IDs with data to be updated and then return a JSON with their updated data.

    EDIT
    Adding some hints: If you have that much data, you need to consider how much data you want to transfer in one go. There could be timeouts due to your system. Therefore, it would be more worthwhile to transmit the data in small packets that are processed quickly. It might also be interesting for you to transfer this data via WP_CLI. This then runs on the console, not per endpoint, and does not have the timeout problem. You can find details here: https://wp-cli.org

    • This reply was modified 4 years, 2 months ago by threadi.
    Thread Starter Josh Robbs

    (@jwrobbs)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using the REST API system for bulk updates’ is closed to new replies.