[resolved] Mass Empty a Category? (6 posts)

  1. Keilya
    Posted 9 years ago #

    Hello, I am currently on WordPress 2.0 and was wondering if there was a way to mass empty a category.

    I've tried searching a found this plugin: http://climbtothestars.org/archives/2004/07/13/batch-categories-09/ but unfortunately, there are no compatible versions released for 2.0 as yet. >.< (If there is, let me know. =O)

    I have access to MySQL databases, if it can be done from there.

    Thank you in advance!

  2. maerk
    Posted 9 years ago #

    You can certainly do it with a custom query, but you need to remember that posts and categories are stored in post2cat as well!

  3. marcrue
    Posted 9 years ago #

    you can always remove the category and create it again. (if you don't want to remove the posts, because they will be moved to the default category.)

  4. Keilya
    Posted 9 years ago #

    maerk: yes...the question is how do I go about doing it? x.x I'm a total nut when it comes to this.

    marcrue: I am aware of that but I wish to retain the cat number, instead of increasing it everytime. =S

  5. maerk
    Posted 9 years ago #

    Well, to get rid of the post it would be something like:

    DELETE * FROM wp_posts WHERE category_id = X

    I'm not sure exactly of the right column name for category ID, you'll have to check that.

    NOTE I would be very wary about that query, I'm not sure if it's correct, or what effects it will have on the rest of the system.

    For example, I don't know how to modify post2cat, which is also involved. Have a look at the database with phpMyAdmin and see if you can work something out, it probably wouldn't be too hard.

  6. Keilya
    Posted 9 years ago #

    Ahh...I see. Thanks a lot. I think I'll need some SQL database lessons before I do anything. =P Meanwhile, I'll wait for the plugin. *crosses fingers*

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic