Support » Fixing WordPress » Delete all posts but not pages

  • databell96


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • vtxyzzy


    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.

    Thanks a lot. lol

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Delete all posts but not pages’ is closed to new replies.