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 full stack web developer, growth hacker, entrepreneur, bike commuter, seinfeld enthusiast, and daddy to three little girls and two dogs in Iowa.

One thought on “WordPress Mass Update Post, Page, or Custom Post Type Taxonomies”

  1. Thanks. You just saved me a lot of effort with apply category script. I had over 2000 custom posts that all needed a new category tag.

Leave a Reply

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