• I’m attempting to create a plugin that will perform mass post updates. It works by retrieving the list of posts to be processed, changing post_content in some way, then calling wp_udpate_post on each to save the changes back to the database. As a way of providing an undo if necessary, I like the fact that a new revision is created if they haven’t been disabled. To avoid PHP timeouts, I’m batching the work with ajax, so each request causes 10 posts to be updated before requesting the next 10, until all have been updated.

    The problem I’m finding is that all those calls to wp_update_post are both slow and resource intensive. I’ve run on a variety of hosted servers and while some hold up better than others, I’d certainly like to improve the performance.

    Any suggestions for a more efficient way of updating the posts (and still creating revisions)?

The topic ‘Efficiently updating many posts’ is closed to new replies.