Deleting All Posts and Comments from a WordPress Blog
Post Info Saturday, July 11th, 2009 5:51 pm by Cody Print Print this page

The best way to understand the tables is to look at the WordPress Databae Design page, so you are aware of the dependencies.  I wanted a nearly clean copy of WordPress, so I executed the following SQL statements:

delete from wp_comments;
delete from wp_links;
delete from wp_posts;
delete from wp_postmeta;
update wp_term_taxonomy set count = 0 where 1 = 1;
delete from wp_term_relationships;

This deletes all comments, links, posts, post metadata, resets the count for the tags/categories/links to 0, and deletes the relationships.  I had to delete more than comments and posts, otherwise the tables would be in an inconsistent state.  For example, it may end up showing more than 1 post under a certain tag when all posts have been removed.   Thus, that explains why I had to set count to 0 for wp_term_taxonomy and remove all the links.

47 Responses to “ Deleting All Posts and Comments from a WordPress Blog ”

  1. ALVIN


    Pillspot.org. Canadian Health&Care.Best quality drugs.Special Internet Prices.No prescription online pharmacy. High quality drugs. Buy pills online

    Buy:Arimidex.Synthroid.Accutane.Petcam (Metacam) Oral Suspension.Valtrex.Prevacid.Prednisolone.Human Growth Hormone.Zyban.Zovirax.100% Pure Okinawan Coral Calcium.Nexium.Lumigan.Actos.Retin-A.Mega Hoodia….

  2. CLIFTON


    Medicamentspot.com. Canadian Health&Care.No prescription online pharmacy.Best quality drugs.Special Internet Prices. Low price drugs. Buy pills online

    Buy:Aricept.Lasix.Acomplia.Advair.Nymphomax.Cozaar.Prozac.Zetia.Benicar.Lipothin.Amoxicillin.Female Pink Viagra.SleepWell.Lipitor.Zocor.Ventolin.Female Cialis.Seroquel.Buspar.Wellbutrin SR….

  3. FLOYD


    CheapTabletsOnline.Com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. Online Pharmacy. Buy pills online

    Buy:Seroquel.Benicar.Amoxicillin.Aricept.Female Pink Viagra.Lasix.Wellbutrin SR.Buspar.Cozaar.Female Cialis.Nymphomax.SleepWell.Ventolin.Lipitor.Zetia.Advair.Lipothin.Zocor.Prozac.Acomplia….

  4. TODD


    CheapTabletsOnline.Com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. No prescription pills. Buy pills online

    Buy:Prevacid.Prednisolone.Valtrex.Zovirax.Zyban.Synthroid.Accutane.Actos.Mega Hoodia.Human Growth Hormone.Petcam (Metacam) Oral Suspension.Nexium.100% Pure Okinawan Coral Calcium.Retin-A.Lumigan.Arimidex….

  5. JESSIE


    NEW FASHION store. Original designers collection at low prices!!! 20 % TO 70 % OFF. END OF SEASON SALE!!!

    BUY FASHION. TOP BRANDS: GUCCI, DOLCE&GABBANA, BURBERRY, DIESEL, ICEBERG, ROBERTO CAVALLI, EMPORIO ARMANI, VERSACE…

  6. CHARLIE

    ████████►BUY CIALIS◀████████…

    ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲…

  7. TIMOTHY

    dosage of amoxicillin for respiratory disorder

    Buygeneric drugs…

  8. TERRANCE

    Abilify

    Buygeneric meds…

  9. RICARDO

    EDUARDO

    FERNANDO

    GREGORY

    ALBERTO

    DARRELL

    GUY

    DENNIS

    MARK

    lisinopril aspirin interaction

    Buywithout prescription…

  10. MATTHEW

    what is the shelf life of zyrtec

    Buynow it…

  11. ARTHUR

    other names for trazodone

    Buyno prescription…

  12. LONNIE

    quinapril

    Buyit now…

  13. NEIL

    Zocor

    Buygeneric drugs…

  14. KARL

    Vitamin B

    Buydrugs without prescription…

  15. RUSSELL

    Zofran

    Buygeneric pills…

  16. CHRISTIAN

    Orlistat

    Buyit now…

  17. RAFAEL

    Eye Drops

    Buynow…

  18. REGINALD

    Synthroid

    Buygeneric pills…

  19. JULIUS

    Ribavirin

    Buygeneric drugs…

  20. HUBERT

    Prozac

    Buyno prescription…

  21. OTIS

    how much benadryl to take with zyrtec

    Buydrugs without prescription…

  22. CHRIS

    Rogaine

    Buygeneric meds…

  23. CURTIS

    Zoloft

    Buynow it…

  24. JULIO

    AARON

    GREGORY

    JOSHUA

    SHAUN

    DENNIS

    JORDAN

    .

    Buynow…

  25. DONALD

    Buywithout prescription…

  26. KURT

    WAYNE

    GEORGE

    .

    Buyno prescription…

  27. HARRY

    .

    Buygeneric drugs…

  28. REX

    EDDIE

    JAIME

    Buygeneric drugs…

  29. ADRIAN