Lessons Learned: WordPress Comments Disappearing and Spam

Today I emailed my favorite coffee company Beanetics to ask them to have a repeating order of coffee and to remind them that I have the #11 Google hit for “beanetics.” OK its not #1 like it used to be, but it still good. While I was checking the permalink for the post, I noticed that all the comments were missing even though it said that there were 2 comments on the post.

I went to login and it didn’t let me in. I had this problem before so I renamed my wp-content/plugins directory. I logged in and there were 0 comments in the system! Yikes! All my WordPress comments had disappeared!

I went into the wordpress MySQL database and when I typed in “select * from wp_comments;” it replied back with the ominous but helpful: “table wp_comments marked as crashed.” Alright, I think we can fix that. I typed in “repair table wp_comments;” and it reported that all was well again.

I went back into my Comments admin and found that there were 10,445 spam comments! 10,445 – spam is bad but I didn’t realize it could crash your WordPress comments bad.

Alright so after verifying that all my approved comments were back, I had lunch. I came back two hours later and found I had 100 emails – all for pending spam comments. Oops – I had disabled the Akismet spam filter when I renamed my plugins directory earlier.

OK so to make sure this doesn’t happen again in the future:

1. I went to Plugins / Akismet Configuration and checked the box “Automatically discard spam comments on posts older than a month.”

2. I went to Comments / Spam and pressed the button “Delete All Spam”. That should tidy up the wp_comments table and the entire WordPress database quite a bit.