Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress: How do I remove the category "uncategorized" from all posts in bulk?

Scenario:

I have 1000 posts that have the "Uncategorized" category, and I want to remove "Uncategorized" from all of those posts and set a different category for those posts.

In other words– take all Uncategorized posts and move them to another category, in one fell swoop.

Can I do this in bulk without going through each post individually?

like image 310
HandiworkNYC.com Avatar asked Nov 28 '22 01:11

HandiworkNYC.com


2 Answers

What you are looking for is the WordPress bulk editor.

  1. Go to Posts > Categories > Uncategorized

  2. Click the "Screen Options" tab in the top right corner, then change "Number of items per page:" to 1000. (If you are on a really slow server you might consider doing less at a time)

  3. Now select all of the items on the page and click the "Bulk Actions" drop-down above the select all and select the "Edit” option.

  4. Hit Apply

  5. In the bulk editor click the “new category” you want to change all of the posts to and hit update.

Once you have added all of the posts to the “new category” you need to remove the “Uncategorized” category. To do this:

  1. Go to Settings > Writing
  2. Now change the “Default Post Category” to something besides “Uncategorized”
  3. Go back to Posts > Categories and delete the “Uncategorized” category
  4. Now you can create the “Uncategorized” category again if you like and change it back to the default.

Once you delete the “Uncategorized” category it will remove it from all of your posts.

If you have some posts that you want to remain in “Uncategorized” then create a new category called “temp” and assign all of the posts you want to remain to that category. Once you delete “Uncategorized” create it again and assign the posts in “temp” back to that category.

like image 92
Shawn Hayes Avatar answered Dec 06 '22 02:12

Shawn Hayes


As you've discovered, the bulk editor only allows the ADDITION of categories to multiple posts - it's not possible to REMOVE categories from multiple posts. The best option i found was to temporarily install this plug-in https://wordpress.org/plugins/bulk-remove-posts-from-category/ (in the WP repository) which adds the ability to REMOVE categories from multiple posts using the same bulk edit method. it simply adds an additional 'remove' checkbox under the category list.

like image 23
Chris Dawson Avatar answered Dec 06 '22 03:12

Chris Dawson