• I am working with WP 1.5.1, and I need to move all the posts from some categories to the new categories. Is posible to do that? Thanks in advance for any help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • There might be an easier way out there, but one way to do it is to go into your database and find the table wp_categories (it might be named something else similar depending on your tables’ prefixes).

    There, note the cat_ID number for the category you want to move the posts FROM as well as the cat_ID for the category you want to move the posts TO.

    Then go to table wp_post2cat and in the field named “category_id” update every instance of a FROM category number to the number of the TO category. If you know a little MySQL it should take a couple of seconds to do.

    There you’ll see the fields “rel_id,” “post_id,” and “category_id.”

    Thread Starter jorgemarsa

    (@jorgemarsa)

    I have no idea about MySQL. I hope “There might be an easier way out there”.

    Well easy is a matter of taste. In the Dashboard/Manage/Posts you can click the edit tag of any post, unmark the original category where the post is published, mark any category (ies ) and republish ( Save ).
    This would be tedious if you are moving many posts, but doesn’t require any MySQL knowledge.

    Very quick MySQL method:

    UPDATE wp_post2cat SET category_id = '2' WHERE category_id = '1';

    Change the “wp_” prefix (wp_post2cat) to the one set for $table_prefix in your wp-config.php.

    Alter ‘2’ from SET category_id = '2' to the numeric category ID you want to change *to*.

    Alter ‘1’ from WHERE category_id = 1 to the numeric category ID you want to change *from*.

    Forgot to note that WordPress “caches” the post count within a category. To reset this, just resave one of the posts that was moved to the new category.

    Thread Starter jorgemarsa

    (@jorgemarsa)

    I don’t dare to go into MySQL and fix the problem. I thougth it would be a plugin or any other solution to solve my problem. Now, I don’t know what to do.

    If you are using 1.5.2 you can use Batch categories

    Thread Starter jorgemarsa

    (@jorgemarsa)

    I am using 1.5.1, could I use this plugin?

    I am not sure. I think there are some security issues with 1.5.1 so it may be wise to upgrade to 1.5.2 anyway. (I think there is a post somewhere that batch categories does not work with 2.0).

    http://static.wordpress.org/archive/ for older versions.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to move all posts from one category to another?’ is closed to new replies.