Forums

Mass Edit: Changing Categories (6 posts)

  1. reloaded
    Member
    Posted 5 years ago #

    Is there an easy way or plug-in that let's me change categories of several entries at once? I've made a few new categories on my blog and I would like to recatorize about 200 posts. Is there an easy way to do this without editing them all one at a time?

  2. tychoish
    Member
    Posted 4 years ago #

    I have the same issue, so I want to bump this back up to the top.

    After the 3.2 transition I have a bunch of entries that are "uncategorized" that didn't go back to the default category. I'd be ok if there were a way to solve this using a simple query, I just don't have a clue on how to do this without mucking it up...

  3. dalebert77
    Member
    Posted 4 years ago #

    This is do the trick, but it will also move all of your pages to the new category as well - I'm sure there is a SQL guru out there that can change this to use a join statement that would filter out pages:

    UPDATE wp_term_relationships SET term_taxonomy_id = 'THE_NEW_NUMBER_OF_YOUR_CATEGORY' WHERE term_taxonomy_id = 1;

    BTW - the term_taxonomy_id = 1 is the uncategorized category.

  4. dalebert77
    Member
    Posted 4 years ago #

    Ok - I took sometime to think about it - this will update all posts only in the uncategorized category and move them to category #5 (you can get the cat number from admin/manage/categories - look at the cat id):

    UPDATE wp_term_relationships
    SET wp_term_relationships.term_taxonomy_id= '5'
    WHERE wp_term_relationships.term_taxonomy_id = 1
    AND EXISTS
    (SELECT *
    FROM wp_posts AS A1
    WHERE A1.ID = wp_term_relationships.object_id
    AND A1.post_type = "post");

  5. tychoish
    Member
    Posted 4 years ago #

    thanks for the update, sorry for my lack of clarity in the inital post. clearly I meant 2.3.

    I like the second query more, of course. my main question, is that the category that I really want to move everything into is the first category, and it looks from all accounts that the first category created and thus it looks like it has the term_taxonomy_id='1' which is why this is so curious....

    thanks.

  6. Sam_a
    Member
    Posted 4 years ago #

    http://robm.me.uk/projects/plugins/wordpress/batch-categories

    This WordPress plugin lets you batch edit your posts: assign multiple posts to a category or delete multiple posts from a category in one fell swoop. Version 1.2 and above also support WordPress 2.3’s in-built tagging system, allowing you to tag and un-tag multiple posts at once.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.