• Common story, I left the site unattended and hadn’t unchecked the allow trackback checkbox. I’ve literally got 30,000+ trackbacks. All other methods described on the net either do not work or not drastic enough. I’ve tried the bulk delete option but can only do ~250 at a time.

    I’m thinking there has to be a query that can remove ALL trackbacks as I looked in my exported xml file and saw that there is indeed an identifier for trackbacks:
    <wp:comment_type>trackback</wp:comment_type>

    Unfortunately, I’m not fluent in WP taxonomy or SQL language, so I have no idea what I would need to run to mass delete every single trackback in the database across all posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Some info and a nice visual representation: Database Description

    I think this might do it, but please make sure you have a database backup before/if you decide to give this a try.

    DELETE FROM wp_comments WHERE comment_type=”trackback”

    Thread Starter meanderingthemaze

    (@meanderingthemaze)

    35493 rows deleted. ( Query took 5.2734 sec )

    5.2734 sec

    NOW THAT’S WHAT I’M TALKING ABOUT!!! 🙂

    Thanks Clayton. Actually I was much closer than I thought. I had figured out the query:
    SELECT FROM wp_comments WHERE comment_type="trackback"

    However, I was in the WRONG database. I had two very similar-in-name databases for two iterations of my blog on my hosting account. And so, the query didn’t turn anything up. There were no comments in that database. But it took your help and me realizing that to get this done.

    Wow, what a weight that has been lifted. I was getting ready to make some popcorn and sit in front of a movie tonight deleting 250 trackbacks at a time.

    Yay! Hope this helps others.

    That’s a lot of trackbacks! Glad it worked okay for you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SQL query to remove ALL trackbacks EVER’ is closed to new replies.