Title: Efficiently updating many posts
Last modified: August 30, 2016

---

# Efficiently updating many posts

 *  [spartank](https://wordpress.org/support/users/spartank/)
 * (@spartank)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/efficiently-updating-many-posts/)
 * 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.

 * 0 replies
 * 1 participant
 * Last reply from: [spartank](https://wordpress.org/support/users/spartank/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/efficiently-updating-many-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
