Changing, Moving & Deleting WordPress Categories

Do you ever look at some of your posts and think they should be in a different category?

Maybe you have 2 categories which are very similar and you want to merge them together.

Of maybe you simply want to delete a category which you have created but haven’t assigned any posts to.

Pretty much anything is possible with WordPress considering its highly flexible.

This guide will show you everything you need to know about creating, changing, editing, moving and deleting WordPress categories.

Here’s a post i wrote earlier about the basics of WordPress categories.

Changing Category Name

All you need to do to change the category a post or posts are assigned to is change it in the category module which is located under every edit posts screen.

Category Module

You might think that this will cause the permalink to that post to break but it won’t.

Even though the permalink will change, the old link will be directed to the new permalink.

The reason for this is that WordPress runs on the post i.d and not the permalink. The post i.d remains the same even after changing the category slug.

Category Slug in Permalink

The category slug is the part of the link between your domain name and the part of the link which contains the post title.

If you have too many categories which are similar, you can consolidate them so you have less categories.

Use the above method and then delete the unused categories.

Deleting Categories

Navigate to the Posts tab in your Dashboard and click the Categories link.

Here you’ll find a list of your categories.

You can easily create new categories here or by using the Category module under all your edit post screens.

You can also add introductory content which will be displayed at the beginning of the category archive page.

If your theme doesn’t allow this, you can simply add a description.

To delete a category, simply click the delete link.

Delete Category

 

If there’s no posts assigned to the category you delete, then it will simply be deleted.

If you do have posts assigned to a category and delete it, the posts will become assigned to the uncategorized category.

You can reassign them before or after deleting the category however its better to move them before you delete the category.

Number Next To Category

As the above screenshot shows, there’s a number 2 next to the category free-wordpress-themes-2.

This can because by a number of reasons.

This may be the second time a category using this exact same slug has been created.

Or it may be caused by a posts tag with the exact same slug.

Or it may be caused by a page or posts with the title exactly matches a category which already exists or did exist.

You’ll need to find out where the duplicate is and change or delete it.

WordPress stores both category and tag slugs in the same database table which is why there can’t be 2 category slugs which are exactly the same. If this happens it simply adds a number to the end which can be 3,4, 5 etc depending on how many times this has happened and how many slugs are the same.

Each permalink needs to be unique which is why WordPress works this way.

Here’s a post about how to fix duplicate category slugs in WordPress.

Delete Uncategorized Category

The uncategorized category is built into the WordPress core.

The only way to delete it is to select a new category to use as your default post category and then delete the category named ‘uncategorized’.

If you go to your writing settings, you will find your Default Post Category is set to uncategorized.

Default Post Category

You can change this to another category so all posts which are unassigned when published, will be assigned to the default post category you set here rather than the uncategorized category.

Uncategorized Category

Converting Categories To Tags

Categories to Tags Converter

By default, you’ll find WordPress includes a link to a plugin which you can use to convert categories to tags and tags to categories. You’ll find the link under the Tools tab in your dashboard and the actual link to install the plugin on the Import screen.

Categories and Tags Converter

If you’ve created far too many categories, you could convert them to tags and assign your posts to a smaller amount of categories.

On the other hand, you may want to convert posts which aren’t assigned to any category but are tagged.

Using the plugin to selectively converter from one to another is the best way to do this.

Simply select which categories you want to convert to tags and click the convert button.

This is a reat way to add tags to your posts and reduce the amount of categories at the same time.

Convert Categories to Tags

Renaming Categories

You can simply rename your categories without changing the category slug.

Go to Posts > Categories and find the category you wish to edit and rename.

Using the Quick Edit link, you can edit the name of the category and change the slug in the permalink as well.

Edit Category Name

Naming Categories

Its best practice to use keywords which describe the posts assigned to that specific category.

One to two word category names are best however you could use 3 or 4 words also.

Its best to keep your categories to a minimum and use tags to group more specific content together within the one category.

Moving Posts To Another Category

I decided to move 63 posts from the plugins category to the WordPress plugins category. No point in  having 2 categories which are the same and all plugins i write about are WordPress plugins anyway.

The easiest way to do this was to set the default post category to WordPress plugins and delete the plugins category.

When you delete a category, all the posts are assigned to the default post category resulting in mission accomplished.

Redirecting Deleted Category Page Archives

Even though posts assigned to new categories will load without error, you’ll notice that links to the old category archive pages will be broken as the old categories have been deleted.

The easiest way to fix this is to redirect any categories you deleted to the new category archive or post tag archives.

You can do this in cPanel or by creating a .htaccess redirect.

Duplicate Meta Descriptions & Titles Tags

I’ve found that after reducing and moving posts to the new categories that the category archives that i deleted are now showing in Google Webmaster Tools under HTML Improvements.

Duplicate meta descriptions 471

Duplicate title tags 487

Learn more about fixing duplicate title tags & meta descriptions.

These may take some time to be removed from displaying in GWMT.

Plugin to Reorganize Categories & Tags

There’s an excellent plugin which helps you reorganize your tags and categories.

It also adds two new options to the Bulk Actions dropdown on term management pages:

  • Merge – combine two or more terms into one
  • Set parent – set the parent for one or more terms (for hierarchical taxonomies)
  • Change taxonomy – convert terms from one taxonomy to another

It works with tags, categories and custom taxonomies.

Conclusion

The reason i wrote this post is because i made the mistake of creating too many categories on this site when i first started out.

At the time of writing i have 48!

Still deciding on what i am going to do however i have learn’t about how to easily change, edit and delete them so it won’t be much work when i have made a decision.

Update: Fixed this problem and assigned my posts to 11 categories.

How About You

Share your thoughts and experiences related to categories in the comments if you like.


Comments

4 responses to “Changing, Moving & Deleting WordPress Categories”

  1. sharon garofalow Avatar
    sharon garofalow

    Great post. I have been blogging 6 years and my categories and tags have never been set up correctly. I’m about to embark on this task – I am worried about my links being affected and not sure about the best way to go about fixing the categories. I will have to go through each post on its own to fix so a plug in doesn’t seem as useful. Will google webmaster tools show me where I need to do the redirects? Or should I take careful notes and once I change the post immediately go back and fix a link. Looking for a process that will cover everything so I don’t cause errors that I can’t go back and find! Any tips would be much appreciated!!

    1. Brad Dalton Avatar
      Brad Dalton

      The redirects can be done many ways however i think its best at the server level using .htaccess or your cPanel account of it includes re-directions.

      I will only need to redirect the categories and tags which you delete or consolidate.

      The posts won’t 404 when you remove the category or tag, only the category or tag pages will.

      Another option is to install the redirection plugin however this can use alot of resources in some cases.

  2. Retha Groenewald Avatar
    Retha Groenewald

    Very useful post. I have very few categories but I tend to have them in hierarchy. Your post has made me realize that too many categories is not good, but too little could has other repercussions.

    1. Brad Dalton Avatar
      Brad Dalton

      Thanks Retha.

      Yes. It shows how easy it is to makes changes to your categories without causing any problems. The amount of categories is debatable and something i’m trying to make a decision on myself.

      I actually got the idea for this post from another blog about WordPress. I wrote this post based entirely on my own testing and experience changing, editing, moving and deleting categories on a copy of this site on my local installation.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.