Backup WordPress to Keep Your Website Safe

It is important and relatively easy to backup WordPress, but you have to take action and do it regularly. I am going to show you four different ways to backup WordPress. Each of them creates the backups differently. I do three of the four on a regular basis. Only two of the methods are redundant and one of them can be automated.

You cannot depend on your webhost to keep a current backup of your website. While it is nice to think that they will have recent copies, most hosts do not guarantee that your site can be restored in the case of a hard drive crash. You should take responsibility to have a recent backup of your WordPress website. Often data loss is caused by user error. You can protect yourself from yourself or even from hackers by making regular WordPress backups.

Backup WordPress Content

Built right into WordPress is a way to export and import all of the content of your WordPress install. This is a flat file that you can save for the purpose of importing into a new WordPress install. Besides being a quick and easy backup solution, this backup makes it easy to move from a hosted blog to a installation on your own web server.

Start by going to your blog's dashboard. Towards the bottom of the left-hand column is the Tools menu. Expand that and choose Export. By default it will export most of your blog's contents. You can choose to limit the exported file to certain dates, categories or authors. There are other limitations you can put on the file, but for backup purposes, you will want to choose everything.

The negative aspects of this backup type is that you do not get all of your media backed up with it. Some of my images were backed up, but not all. My comments were not backed up either. While it is an easy backup, it is by no means complete.

Backup WordPress Structure

Using an FTP program you can, and should, backup your WordPress themes, structure and media. This will only work with an installation of WordPress on your own web host (a installation). This method will not work on a hosted website. While you may have your data backed up using one of the other methods, none of them actually back up your WordPress structure. Any changes you make to your WordPress theme can only be backed up by copying those changes to your computer from your webhost.

This is not as simple as clicking a couple of buttons, but definitely worth the effort if you have made any changes to your WordPress theme.

Open an FTP program and connect to your account at your webhost. You really only need to backup the folder wp-contents and everything in it. By copying the folder to your hard drive you will be copying all of the theme files (along with your changes) and all of your media. If you have a lot of pictures on your blog, this could take some time to copy. For example, my oldest website contains 120 MB in this folder.

Besides the wp-contents folder, there is one other file you should copy to your hard drive: this is the wp-config.php file in the main folder of your WordPress install. Because the whole WordPress installation is less than 10 MB in size (besides your wp-contents folder), then it is easy to simply copy the whole installation back to your local computer's hard drive. This ensures that you have a complete backup of everything related to the structure of your WordPress installation.

Backing up WordPress this way is the only way to preserve any of your theme changes. If your webhost crashes, or you make a mistake in altering a file related to your theme, you can easily restore the structure of your site using this backup. This method also is the only one to relaibly backup your media (uploaded photos, videos or audio files).

It is important to remember that this type of backup does not backup your posts, comments and other associated data. You must use one of the other backup methods for those items.

Backup WordPress Database Through a Plugin

There are two ways to backup the WordPress database: using a plugin or through phpMyAdmin. Both can be used if you host an install of on your own server. The plugin method is the only way to backup the database when using We will start with the easier of the two methods first.

From your WordPress dashboard click on Plugins. There is a link at the top of the next page and one down on the side which say Add New. Click on either one of those links and search for wp-db-backup in the search box on the following page. Install the plugin by clicking the link that says install now.

Once the plugin is installed you will find a new link in the Tools menu on the left sidebar of your dashboard. It simply says Backup. When you click on that you can choose which parts of the database you want to backup. By default it will backup the critical data for your website. There are other plugin-related tables that you can manually choose to backup.

Backup options are: backup the file to the server, download the file to your computer or have a backup emailed to you. Alternately, you can schedule a backup which will be emailed to an address of your choice.

Making a WordPress backup using this method will give you the full contents of your database, but does not include the structure or media of your website. You will still need to backup the wp-content folder from the previous step.

Backup WordPress Database Through phpMyAdmin

This method gives exactly the same results as the previous method, however it is much more capable and complicated. The reason you might want to use this method is to avoid installing a plugin. There are more fine controls you can put on your data by using this method as well. This means you can backup only parts of your database that you feel are important, or you can include even more tables than the plugin above allows. This method is only available if you host WordPress on your own web server.

Log in to the administration panel of your webhost. You may have a version of cPanel, webmin or one of many other webhost control panels. Whichever one you use, you are looking for phpMyAdmin. This is an interface which allows you to directly manipulate the data inside your WordPress database. Approach with caution!

Once you have the database open in phpMyAdmin choose the Export link on any of the pages within the database. On the next page under the Export box, choose select all (you can choose only tables you want if you are making a custom backup for a specific purpose). Then choose the type of file you want to export the database to. By default this is set to SQL which is appropriate.

Leave all the default settings and choose these additional options: Add DROP TABLE, Complete inserts. Choose the Save as file box too. You can choose to compress the database or leave it uncompressed. If it is a new installation then leaving it uncompressed will not matter much. Once your database grows significantly in size, it will help to compress the database. You do not need to understand the compression options nor be able to read the file for this to work. When you restore a database backup, the system can read the compressed data file. Choose any of the compression options and click the Go button to save the file to your computer.

This method is functionally the same as using the plugin option above. It has the added benefit of choosing only certain parts of your database that you feel are important. Because of the easy plugin option, this method only needs to be done if you need more control over the backup or you do not want to install plugins on your system.

Backup WordPress Conclusion

Remember that you will need to do at least two of these different backups. Only one creates a backup of your theme changes and media. While the first method is easy and built into WordPress, it is not a complete backup. The best option is to backup the content (the second method mentioned above) and to backup the database using the WP-DB-Backup plugin.