Bulk edit contents of pages

For any other readers I’d like to add in advance that this only really makes sense if you are kind of creating drafts or templates or whatever you want to call it that will be changed later on. Otherwise you’ll at least deal with SEO penalties due to duplicate content.

Unfortunately this functionality isn’t part of WordPress by default so you’d need to find or create a plugin for that.

One other option is to use wp-cli in case you do feel comfortable using the command line.

wp post update <ids> --post_content=<new content>

Using the wp post update command you can easily edit the content of multiple posts. So for example if you want to edit the posts with the ids 1, 2 and 5 to be changed to “other content” use this command:

wp post update 1 2 5 --post_content="other content"

You can see the ID from the edit screen by hovering the edit link and looking for the ID there.

site.tld/wp-admin/post.php?post=5&action=edit

To easily get all ids for some condition like a category (books in this example) just use the wp post list command.

wp post list --category_name=books --format=ids

This will return something like 1 2 5 which you can then use in the query mentioned above.

Be sure to read the documentation of the commands mentioned above because they offer various other options and commands that could help, like getting the content from a file.