WordPress batch processing doesn’t exactly sound like the most exciting aspect of programming (regardless of the platform, really). And working with large sets of data in WordPress usually comes down to one of two solutions:
- using WP-CLI,
- performing migrations with WP Migrate DB Pro.
Both of these solutions are great, and they do their job well; however, there are times when you’re working with large sets of data within the WordPress administration area that could be manipulated with a simple batch process.
This isn’t to say that using the command-line is bad, but sometimes toggling a few options to work with posts, comments, or other data types would be nice.
And that’s what Locomotive from Reaktiv Studios allow us to do.
WordPress Batch Processing
Straight from the project’s page on GitHub:
Locomotive handles the complexity of batch processing by automatically chunking up data, checking for records that have already been processed and logging errors as they come in.
Of the features that it offers, one of the things I like the most is that it allows us, as developers, to create our set of functions to page through data in the database then automatically create a batch process around those records.
Sure, this kind of stuff is often part of a personal library that we may have stashed around, but having something formally put together that’s also undergone testing, code scrutinization, and is open for contribution from others makes it that much more resilient.
For more information, you can read the blog post that includes several examples explaining how to use the plugin programmatically, too. And for those looking to add feature requests, report bugs, and issue pull requests, you can do so on the project’s GitHub page.
Whatever the case, having a plugin that fits squarely in the middle of some already great options is a welcome addition to what we have available in our set of tools.