Linux Administrator - Unwanted comments in Wordpress

Linux Administrator

Privacy Policy

RSS Feed


Acoustic Guitar Tips
Anna Kendrick
Beekeeping Tips
BLISS
Carpentry
Catherine Zeta Jones
My View On Things
Cheap Auto Insurance
Cheap Places to Live
Delta Shaper
Easy Wood Projects
Felicity Jones
Free Sheet Music
Funny Clean Jokes
Healthy Carbs
Heidi Klum
Improve Your Credit
Ivory Tower Group
Keke Palmer
Linda Ronstadt
Linux Administrator
Money Spigot
Nicole Kidman
Planet Cabinet
Quality Dating Advice
Rustic Cabinets
Sacramento Hiking
Sandra Bullock
Spintax Tool
The Actress
Tristan Prettyman
Viola Davis
Who Are The Beatles


Unwanted comments in Wordpress

Unwanted comments in Wordpress

I got a call from a client complaining about a huge amount of comments in her wordpress blog. I checked it out, and sure enough, it was all spam for some product or another. No valid comments whatsoever. Thankfully, none of it was showing up in her blog, since she had the moderation option turned on. However, it was truly annoying dealing with so many spammy comments, and she wanted to get rid of them all. After a bit of research, I found a line if sql code that could do it.

First, I made a backup of her wordpress mysql database, in case what I was going to do didn't work. Then, I fired up phpmyadmin, selected her database, and clicked the sql tab. Here's the query I entered:

SELECT *FROM wp_comments WHERE comment_approved ="0"

After that, 282125 records were selected. I then followed with this query:

DELETE FROM wp_comments WHERE comment_approved ="0"

After a big delete like this, you may want to run a repair on your db, just in case. To do that, click on the Structure tab to show all the tables in your database. Then, click the Check All option. In the dropdown menu to the right, select Repair Table. That will do it.


Return To Main Page