RolloTamasi
Member
Posted 1 year ago #
Hi guys, I'm in the process of merging two blogs together. I want to reshuffle the categories I am using. Is there an easy way to migrate all the posts from one category to another category?
For example:
I have 10 posts in the category 'software' and 5 posts in the category 'hardware'. I want to move all of those posts into a new category called 'technology' on my blog.
The only way I can do this (for what I have seen) is to go into each individual post and remove the post from the old category and to add it to a new category. I have over 120 posts on both of these blogs so that is going to take quite some time and there is an increased chance that I could make a mistake.
I'm hoping there is a plugin or a simple way to select all posts from a category and to move them to another category. I haven't found anything yet though. Any ideas?
Not too sure about a plugin, but assuming you know the term_taxonomy_id of the old and new category you could using phpMyadmin with a SQL statement such as:
UPDATE wp_term_relationships SET term_taxonomy_id = '10' WHERE term_taxonomy_id = '299'
Assumes:
table name is wp_terms_relationships
old category term_taxonomy_id is 299
new category term_taxonomy_id is 10
Backup your database before attempting.
Read http://www.dagondesign.com/articles/wordpress-23-database-structure-for-categories/ for info on understanding the term taxonomy relationship.
Actually, there is a plugin out there called Batch Categories which performs the functions you are looking for. You can mass move a series of post from one category to another.
http://robm.me.uk/projects/plugins/wordpress/batch-categories
By the way, this plugin has been integrated into the core of WordPress 2.7