WordPress.org

Ready to get started?Download WordPress

Forums

Mass Deleting posts (13 posts)

  1. Chad_Coleman
    Member
    Posted 9 years ago #

    Is there a fast way to delete all posts in wordpress?

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    ALL ?
    Everything ?
    Yes, use phpmyadmin and empty the posts table..... it'll do no good to keep any comments either .. and the categories will still be there...
    Do be sure - there is no UNDO function.

  3. Chad_Coleman
    Member
    Posted 9 years ago #

    umm.... i dont have access to the phpadmin...
    any other way?
    Im surprised the WP guys didnt think of that one...

  4. Well, if you don't mind losing a few prefs and starting over, just delete your MySQL database and then create a new one. I'm sure the devs just figured that if someone wanted to delete all their posts, then they would want to delete the installation too. Therefore, there's no reason to have a "delete all posts" function.

  5. NuclearMoose
    Member
    Posted 9 years ago #

    Delete the database. Why build in a function that can be done with another, more appropriate tool?

  6. Chad_Coleman
    Member
    Posted 9 years ago #

    Thanks guys.

  7. dherren
    Member
    Posted 9 years ago #

    While deleting ALL posts is a simple thing to do, what if I want to delete all of the posts in a particular category, but retain the category? Of course I could delete the category and then recreate it, but that moves the posts to the default category, and I would still have to delete them from there.

    To put this in context, I use WP in an academic setting. Each year my students make hundreds of posts in some categories which I want to delete, while retaining other posts in other categories.

    Tangential question.; Is there a way to view all the posts in a particular category within the admin interface?

  8. Kafkaesqui

    Posted 9 years ago #

    "While deleting ALL posts is a simple thing to do, what if I want to delete all of the posts in a particular category, but retain the category?"

    Going back to the SQL thing, this slightly complicated SQL statement will do what you're after:

    DELETE FROM wp_posts, wp_post2cat USING wp_posts, wp_post2cat WHERE ID=post_id AND category_id="100";

    The final value ("100") would be the numeric ID of the category to delete the posts from. If not using the default table prefix (wp_), you'll have to modify the table references in the statement to reflect that.

    Tangential question:

    http://www.coldforged.org/the-enhanced-view-plugin/

  9. dherren
    Member
    Posted 9 years ago #

    "DELETE FROM wp_posts, wp_post2cat USING wp_posts, wp_post2cat WHERE ID=post_id AND category_id="100";

    The final value ("100") would be the numeric ID of the category to delete the posts from. If not using the default table prefix (wp_), you'll have to modify the table references in the statement to reflect that."

    That's a thing of beauty!

    Still another question... I don't see that that will delete any comments made to the posts. Am I correct?

  10. Kafkaesqui

    Posted 9 years ago #

    "I don't see that that will delete any comments made to the posts. Am I correct?"

    No, and it's missing only due to my lacking a fuller understanding of SQL table joins. There's also the problem that testing DELETE statements (even on a test database) can take a lot out of you when things don't go as planned... But I'm working on SQL stuff tonight (yep, coincidence), and will see if I can wrap my head around a solution.

  11. mrjcleaver
    Member
    Posted 7 years ago #

    Any update on this?

  12. bernadette
    Member
    Posted 7 years ago #

    any update on the enhanced view plugin?

    thanks

  13. hypoluxa
    Member
    Posted 7 years ago #

    I've actually used this program (Win version) to access my dB on my desktop and delete mass posts. You can to click a check box for each post you want to delete, but it works.

    http://www.webyog.com/en/

    The Community Edition is free.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.