WP: Cleaning up your Database

wordpress targetedOccasionally some naughty person will target and access your WordPress installation and spam your “comments” with thousands of messages.

This will bloat your database.
You might find that its normal size of around 5mb has suddenly increased to 700mb!!!

Yikes. Not just your website is going to suffer, the whole server is going to slow down.

How have they done this?

The most common way is through a flaw (a security hole) in an old plugin that you have forgotten to update.

Lesson: always keep your whole WP installation up to date.

How do you fix it?

NOTE: before attempting to fix anything, always make a backup of your database!!!
There are a number of plugins which can help you. We often use this one…
https://wordpress.org/plugins/backupwordpress/

There are a number of WordPress plugins that can help you clean up your database and remove the unwanted comments.

https://wordpress.org/plugins/spam-comments-cleaner/
http://www.youngtechleads.com/wordpress-database-cleaner/

How can you prevent it?

Luckily there are several WP plugins that can ward off unwanted visitors and beef up your security.

The WordPress owned Askimet and Jetpack are essentials
https://wordpress.org/plugins/akismet/

Jetpack – WP Security, Backup, Speed, & Growth


Wordfence
This will keep a watchful eye on your WP installation.
It will email you to let you know if anything is out of date.
It will also email you every time someone logs in.
An it it keeps a monthly log of any IP addresses that its blocked.
Plus it does a ton of other stuff.
https://wordpress.org/plugins/wordfence/