1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mass deleteing posts Easy way?

Discussion in 'Blogging' started by Bostoncab, Dec 19, 2011.

  1. Bostoncab

    Bostoncab Elite Member

    Joined:
    Dec 31, 2009
    Messages:
    2,255
    Likes Received:
    514
    Occupation:
    pain in the ass cabbie
    Location:
    Boston,Ma.
    Home Page:
    I have some sites that have upwards of 10,000 posts from autoblogging plugins. I want to delete all of these posts. Anyone have an easy way? Perhaps something in the mysql settings?
     
  2. Virus1

    Virus1 Supreme Member

    Joined:
    Dec 13, 2010
    Messages:
    1,326
    Likes Received:
    1,409
    Occupation:
    destroyer of worlds...
    Location:
    Welcome to Black Hat World........................
    Home Page:
    You want to delete all of the posts... or just most of the posts?
     
    • Thanks Thanks x 1
  3. scrapefox

    scrapefox Power Member

    Joined:
    Dec 3, 2011
    Messages:
    692
    Likes Received:
    277
    Someone please confirm/deny this, but I think if you head over to cpanel, then phpmyadmin. Then go to the correct database and to the dbname_posts table and choose operations across the top menu.

    In the bottom right hand corner there's an option "Empty the table (TRUNCATE) " which will delete ALL posts.

    *edit - actually just backed up the table and confirmed it myself for you. It will delete all posts and empty the table.
     
    • Thanks Thanks x 1
    Last edited: Dec 19, 2011
  4. Bostoncab

    Bostoncab Elite Member

    Joined:
    Dec 31, 2009
    Messages:
    2,255
    Likes Received:
    514
    Occupation:
    pain in the ass cabbie
    Location:
    Boston,Ma.
    Home Page:
    all of the posts... I want to keep the pages.
     
  5. Bostoncab

    Bostoncab Elite Member

    Joined:
    Dec 31, 2009
    Messages:
    2,255
    Likes Received:
    514
    Occupation:
    pain in the ass cabbie
    Location:
    Boston,Ma.
    Home Page:
    Ok this works great thank you! +rep and thanks given. However is there an easy way to tell in the database which db goes with which domain? I have 60 or so domains!
     
  6. Bostoncab

    Bostoncab Elite Member

    Joined:
    Dec 31, 2009
    Messages:
    2,255
    Likes Received:
    514
    Occupation:
    pain in the ass cabbie
    Location:
    Boston,Ma.
    Home Page:
    Wait!

    That is deleting pages too...GRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
     
  7. scrapefox

    scrapefox Power Member

    Joined:
    Dec 3, 2011
    Messages:
    692
    Likes Received:
    277
    There might be a faster way than this, but if you load up your ftp client and go in to the subfolder for each domain and take a quick peak at the wp-config.php it has the database info inside.
     
    • Thanks Thanks x 1
  8. scrapefox

    scrapefox Power Member

    Joined:
    Dec 3, 2011
    Messages:
    692
    Likes Received:
    277
    Just played around a little on one of my blogs and this seems to work.

    Code:
    DELETE FROM wp_posts
    WHERE post_type = 'post';
    Will delete all posts, but keep all pages and attachments.
     
    • Thanks Thanks x 1
  9. jamesvick

    jamesvick Senior Member

    Joined:
    Jul 26, 2010
    Messages:
    968
    Likes Received:
    653
    Location:
    article directories
    Home Page:
    to see which db goes to which website, you can check wp-config file. Open it and see which site has which db attahced.

    Then in phpmyadmin open the required db, goto sql and type the above statement and click go / execute. It will perform the query but since it is 10,000 posts might take time.

    Make sure to create a backup too. :)
     
    • Thanks Thanks x 1
  10. Bostoncab

    Bostoncab Elite Member

    Joined:
    Dec 31, 2009
    Messages:
    2,255
    Likes Received:
    514
    Occupation:
    pain in the ass cabbie
    Location:
    Boston,Ma.
    Home Page:

    Bro can you go a bit slower witht hose directions? Im dumb.
     
  11. scrapefox

    scrapefox Power Member

    Joined:
    Dec 3, 2011
    Messages:
    692
    Likes Received:
    277
    Sorry. Go back on to phpmyadmin like before and go to the database you want to delete the posts from. Now at the top menu there will be a option SQL. Click that and paste the code I just gave you in to the box provided (deleting anything that's there already) then hit go.
     
    • Thanks Thanks x 1
  12. backontrack

    backontrack Power Member

    Joined:
    Jun 5, 2011
    Messages:
    517
    Likes Received:
    430
    Occupation:
    Father, Web development
    Location:
    I Love Apricot
    This thread helped me out. Thanks!
     
  13. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    939
    Likes Received:
    256
    Occupation:
    programmer
    Home Page:
  14. Bostoncab

    Bostoncab Elite Member

    Joined:
    Dec 31, 2009
    Messages:
    2,255
    Likes Received:
    514
    Occupation:
    pain in the ass cabbie
    Location:
    Boston,Ma.
    Home Page:
    Can someone help me take all the posts from one database and import them into another database?
     
  15. vodkaa

    vodkaa Junior Member

    Joined:
    May 23, 2013
    Messages:
    119
    Likes Received:
    23
    Run a query on the database to delete all entries in the posts table that are set to the type post.
     
  16. visualization

    visualization BANNED BANNED

    Joined:
    Jul 24, 2013
    Messages:
    52
    Likes Received:
    8
    you can try this! i know that this will work out!
     
  17. scrapefox

    scrapefox Power Member

    Joined:
    Dec 3, 2011
    Messages:
    692
    Likes Received:
    277
    It works fine. The OP used the query I provided earlier to do just this.
     
  18. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    939
    Likes Received:
    256
    Occupation:
    programmer
    Home Page:
    YOU MUST NEVER EVER DO THIS!

    When you delete posts with a SQL query, you leave all the associated post comments, post meta fields, and relationships between the post and taxonomy terms, images etc. In other words, you leave tons of trash in both database and the uploads folder.

    To delete the post in a proper way (completely with all the related files, meta fields, comments etc), you must use the wp_delete_post function.

    The WP-Mass-Delete plugin does it properly (as it recommended by the WordPress team).

    screenshot-1.png
     
    • Thanks Thanks x 1
    Last edited: Jul 27, 2013
  19. jokel661

    jokel661 Regular Member

    Joined:
    Sep 26, 2009
    Messages:
    437
    Likes Received:
    495
    Occupation:
    Full Time IM & Developer
    Location:
    NYC & Prague
    You can use Mass Delete plugin to delete all the posts or some of them within minutes.i used it to get rid of 4000 posts within munutes.
     
  20. ailia

    ailia Jr. VIP Jr. VIP

    Joined:
    Feb 27, 2012
    Messages:
    679
    Likes Received:
    49
    scrapefox has recommended the perfect solution