WordPress.org

Forums

Delete all posts but not pages (3 posts)

  1. databell96
    Member
    Posted 3 years ago #

    I'm trying to delete all the posts from a clients blog. It's over 6,000 of them and I thought originally I could just Empty everything out of WP-Posts, unaware I was also deleting pages too. Glad I had a backup! So I'm back where I started but now I need to find a way to delete all my posts but keep my pages intact. Tried the Bulk Delete plugin but it didn't work. So is there some kind of SQL command I can use?

  2. vtxyzzy
    Member
    Posted 3 years ago #

    You can delete in batches of 999 by doing this:

    First change the number of posts shown on each screen:

    • Go to Admin->Posts.
    • Click 'Screen Options' at top right.
    • Enter 999 under 'Show on screen'.
    • Click 'Apply'.

    Now, delete a batch:

    • Click the checkbox next to 'Title' under 'Bulk Actions' to select all posts on the page.
    • Click the dropdown for 'Bulk Actions' and select 'Move to Trash'.
    • Click 'Apply'.
    • Repeat as necessary.

    If 999 causes the process to time out, reduce the number.

  3. Huijun
    Member
    Posted 2 years ago #

    Thanks a lot. lol

Topic Closed

This topic has been closed to new replies.

About this Topic