Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
1  
And if afterwards you could recreate the category if you need it for something else. –  janw Sep 13 '12 at 13:28
1  
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
add comment

Your Answer

 
discard

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.