WordPress Mass Update Post, Page, or Custom Post Type Taxonomies

I’m working on a massive WordPress migration project and after we defined taxonomies they needed to be changed or updated. I tried doing this with SQL but that turned into an Inner Join nightmare due to how taxonomies are related to posts in the database. This script also comes in handy if you want to run mass updates to add all posts to a new category. When you are dealing with thousands of pages doing this manually in the WordPress admin becomes tedious.

So, you can drop these handy little scripts in your theme’s functions.php file for one time updates. These work for posts, pages, custom post types along with categories, tags, and custom taxonomies.

Apply Category To All Posts

Swap All Pages From One Custom Taxonomy Category To Another

This is one of the main reasons I wrote this script. We had hundreds of miss-classified pages in our custom taxonomy and I wanted to swap everything categorized as “News Releases” to another category called “Featured”. As mentioned above

Hopefully this saves you some time. Let me know in the comments if you have any questions.

Published by

Andy Brudtkuhl

Andy is a web developer, entrepreneur, bike commuter, seinfeld quoter, and daddy to two little girls and three dogs in Des Moines, Iowa.

Leave a Reply

Your email address will not be published. Required fields are marked *