How to Merge Categories in WordPress

In our previous post on cleaning up tags in WordPress, some of you feedback that you are looking for ways to merge categories too. In this tutorial, I will show you how to merge categories in WordPress.

Situation

When iPhone first launched, we created a category called “iPhone” for every article related to iPhone. Later when the iPad was released, we again created another category call “iPad”, since at that time, iPhone and iPad are two different devices. When Apple merged all its mobile OS into the current iOS, there seems to be very little differences between iPhone and iPad anymore. In this case, rather than maintaining two different categories of similar context, it is much more efficient to merge them together into one single category.

The merging process

Here is what we need to do:

1. Move all the posts from one category to the other (the one you want to merge into).
2. Delete the duplicate category.
3. Add a URL forwarder to redirect the previous category URL to the new URL.

The steps

1. In your WordPress dashboard, go to “Posts -> All Posts”. Filter all the posts with the category you want to delete.

category-filter

2. Check out the number of posts in this particular category.

category-no-of-items

At the top of the screen, click Screen Options and enter the number of posts to appear on the screen.

category-set-posts-on-screen

3. Check every single post in this category. Click Edit.

4. Add the category that you want to merge into.

category-change-category

5. Once done, go to “Posts -> Category”. Delete the category from the list.

6. Lastly, using a FTP application, download the .htaccess file (assuming you are using a Linux web host) from your server root. Open the .htaccess file with a text editor and addd the following line to the top of the file.

redirect 301 relative-path-to-old-category-url http://your-domain.com/path-to-new-category-url

For example, the old category URL is at http://your-domain.com/category/old-category and the new category URL is http://your-domain.com/category/new-category. So in your .htaccess file, you will put:

redirect 301 /category/old-category http://your-domain.com/category/new-category

Save and upload (and replace) the .htacess file to your server.

That’s it. Alternatively, you can install the Redirection WordPress plugin to manage the redirection. This will, however, increase your server load. Using the .htaccess method is more straightforward, though it can be a little bit intimidating to the new users.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Damien Oh Avatar

Read next

Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
A species of jellyfish called Turritopsis dohrnii can revert its adult cells back to a juvenile polyp stage when injured or starving, effectively restarting its life cycle, and biologists have so far failed to identify any natural limit to how many times it can do this.
A Japanese man named Jiroemon Kimura, who lived to 116, was born in 1897 when Queen Victoria still ruled and died in 2013, meaning a single human life personally overlapped with the invention of the airplane, the atomic bomb, the internet, and Instagram
The Hollywood sign originally read HOLLYWOODLAND when it was built in 1923 as a real estate advertisement for a housing development, and it was only meant to stand for 18 months, but nobody ever got around to taking it down and the city eventually adopted it as a landmark
Almost all of the world’s internet traffic does not travel by satellite but through fibre-optic cables lying on the ocean floor, a hidden web of wires crossing the deepest parts of the sea to connect the continents.
People who flip their phone face down on every table aren’t being secretive. They figured out that staying interruptible meant handing their time to whoever rang first
Twitch vs. Facebook Gaming vs. YouTube Gaming: What’s the Best Live Game Streaming Platform?
Chrome Extensions Ownership Transfer is a Direct Threat to You: How to Stay Safe