WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to remove all posts from all categories? I found plugin for this, but it's very slow. What I need is MySql query that will help me remove all posts from all categories. If you know how to implement the same code, but only to specific category, that would be useful to have for reference too. So how to disassociate all post that belong to one category from all categories (therefore they will belong only to default 'uncategorized' category). Thanks a lot.

share|improve this question

Have you tried just deleting all the categories in Posts > Categories? When you delete a category, it only deletes the category and NOT the posts. All the posts will then default to uncategorized.

share|improve this answer
And if afterwards you could recreate the category if you need it for something else. – janw Sep 13 '12 at 13:28
Thanks for suggestions guys. I did looked into that and notice it takes some time to delete categories. I have close to 300 and 20,000 posts in this database. Hence I want to move it and clean up. But I am noob with WP and was thinking that it would be good to learn some tricks, such as this mysql query... Still your suggestion stands as the best solution for now. If no there is no query or any other trick, I'll go for your solution in a few days. Thanks Bryce and Janw. – Dean Sep 13 '12 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.