Viewing 12 replies - 1 through 12 (of 12 total)
  • 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.

    Thread Starter chad_coleman

    (@chad_coleman)

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

    Moderator James Huff

    (@macmanx)

    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.

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

    Thread Starter chad_coleman

    (@chad_coleman)

    Thanks guys.

    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?

    “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:

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

    “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?

    “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.

    Any update on this?

    any update on the enhanced view plugin?

    thanks

    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.

    https://www.webyog.com/en/

    The Community Edition is free.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Mass Deleting posts’ is closed to new replies.