Is there a way to remove categories in bulk?

I just migrated to worpress and want to remove all of the ‘uncategorized’ categories, since all of my posts are now all categorized. Is there a way to do this easily?

Related posts

Leave a Reply

5 comments

  1. Yes and no. The main ‘uncategorized’ category is the main one built into the core, and shouldn’t be removed. You can rename it to something else. If they are still attached to the posts, then you could delete it from the database tables directly.

  2. Yes, you can. By following what @Innate said, I created a new category called “General”. All the bulk posts I created earlier (from BulkPress plugin) had “Uncategorized” and “my-own-category” (added by Bulk edit). Then, I chose “General” as my default category under Settings > Writing. Next, I deleted the category “Uncategorized”. “Uncategorized” was removed from all the posts, leaving “my-own-category” as the only category. Plus, all new posts that I don’t create a category for will be marked as “General”, which I like more than “Uncategorized”.

  3. As far as I know this is not possible via the GUI. That could be done by a little script that queries all posts that have more than one category and the “uncategorized” category and then removing the “uncategorized” category. I’m working on it.

  4. Crazy old post but in case you get here through Google, here is what worked for me using WP CLI

    wp post list --fields=ID --format=csv | while read line ; do wp post term remove $line category uncategorized ; done