Files or Database – Which part of WordPress should you backup?


Backing up WordPress is essential if you want to make sure your blog survives the unexpected. Maybe you accidentally delete all your files, or you forget to pay your host and they delete your account and everything associated with it. There are many things that can wipe out the dear blog of yours. Luckily, you can prepare yourself by taking frequent backups. You can either download the files by hand, or use automated methods to save your time and nerves!

In this article, I will briefly tell you more about WordPress installation and taking a backup copy of it. The installation is made up from two different parts: the flat files and database. Both serve important yet different purpose, and I will start with the files.

The flat files include HTML, PHP, CSS and JS code that make up the core of WordPress – how everything looks and behaves is coded into the files. While many of these files are static – meaning you never need to actually edit them – the temptation to edit some of the files (such as your theme’s CSS or functions.php) exists. In essence, if you ever edit your WordPress files either directly or through the WordPress admin panel, it means that in the event of data loss you will also lose the edits. That is why you should also back up your WordPress files, not just the database. You don’t need to back up all files, just the ones you have edited. That being said, the automated method will take care of all files, just to be sure.

How about the database then, is it important if files contain bulk of the WordPress installation? Sure, database is vital, actually more important than the core files! You see, all WordPress posts, comments and settings – pretty much everything you can change in the admin panel (minus the themes/plugins editor that accesses files) will be saved in the database. In case of losing your data, if you don’t care about the lost settings, perhaps you don’t want to lose all your dozens or even hundreds of posts? Indeed, you should absolutely back up the WordPress database, especially the wp_posts table but preferably the whole database. That way, if the unthinkable happens and your database gets deleted for some reason, you can easily import the backed up database and have all your posts, comments, settings and other things intact!

The backup frequency much depends on your posting frequency. You should back up the database as often as you make a new post. In another words, if you post daily, also back up the database daily. This way, you will have all your posts in the backup database in case of data loss. Backing up the files is a different beast: if you don’t make much edits to WordPress core files (directly or through the themes/plugins editor), you don’t need to back them up often. I run the files backup once a week because I now and then make minor edits to WordPress code. Database backups I run every day.

So, now you should know a bit more about WordPress backups. Do not forget to do yours, and if you only remember one thing from this article, it’s that backing up the database is the most important thing you can do!

Share Your Thoughts

Have something to say about this post? Then say it by filling the form below!