Often overlooked, but when a Website is compromised and all else fails, restoring from a backup is your best ( only ) option. It's just good practice, bad things happen, even if you are not hacked, your Website could break for a million different reasons. I've seen updates break sites, installing plugins, hosting companies accidently deleting accounts, it goes on and on. You always need a backup as your last resort.
It is important to remember that your WordPress Website is made up of both files and a database. WordPress uses a database to store not only all of your content, but also many important configurations. If you do not include your database in your backup, it's basically worthless. Think about it, the most valuable part of your Website is the content. The good news is, there are many ways to backup your database, everything from using the built-in database manager ( PHPMyAdmin in most cases ), to plugins that will backup automatically on a set schedule. What ever choice you make, be sure you backup your database when ever you backup your WordPress site.
What you backup and how often depends on many things specific to your site, but at a minimum, you should backup your Website ( files and database ) before AND after making any major changes. It doesn't have to be a chore, there are a lot of options for automatically backing up your site to a remote location. But the key is, it is a remote location. If you backup is on the same server as your site and the site is compromised, you can not trust that backup. For WordPress, there are several plugins which will backup your Website to a remote location on a set schedule.
A final word on backups, test. How do you know you will be able to recover your Website if you face a total loss? Have you ever backed up your computer only discover your backups don't contain all of the information you thought they did? It's better to discover you have a problem with your backups before you need them.
When considering a backup strategy:
- Think about how often the content of your Website changes.
- Be sure to backup both the files and the database.
- Always backup before AND after major changes and updates.
- Backup to a remote location.
- Periodically test your backup.
There are other, more sophisticated ways to maintain backups of your WordPress site, including version control like Git, that we didn't touch on here. These are great solutions for Websites with complex programming or sophisticated themes, but they are not a replacement for good backups. And for most small business sites, having a good backup is really all you need.
If you would like to talk to a WordPress expert about your backup strategy, please contact us.