Often we get asked which WordPress files should I backup? Having an up to date WordPress backup protects you against unexpected server failures and hacks. However you don’t to backup every file if you don’t want to. In this article, we will tell you which WordPress files are important to backup and the right way to do it.
Why Setup a WordPress Backup?
All websites on the internet are vulnerable to hacking attempts, DDOS attacks, data theft, and data loss. This could happen to even the most secure websites on the internet.
A WordPress backup solution for your website, is your insurance against all those terrible things. It allows you to keep your content safe and restore your website after an accident.
Many beginners believe that their sites probably don’t need a backup system. Until they come across an accident and realize how easy it would have been if they had a backup.
What’s the Best Way to Create WordPress Backups?
The best way to setup a backup is by using an automated backup system.
There are several free and paid WordPress backup plugins available. You can take a look at our expert pick of the best WordPress backup plugins.
If you have the budget, then we recommend using VaultPress. It automatically syncs your changes, keeps daily backups with security scans and easy restore. We use VaultPress for all our WordPress projects.
However most owners don’t like paying a monthly fee. That’s why we recommend using BackupBuddy. It is the most popular WordPress backup plugin in the market. See our tutorial on how to keep your WordPress content safe with BackupBuddy.
Remember, you will only have to setup a backup solution once. After that, it will automatically create backups for you.
Which WordPress Files to Backup?
Your WordPress site has three kind of files and one database.
- Core WordPress Files
- Files in the wp-content Folder (your theme, plugins, and uploads)
- WordPress configuration files
- Your WordPress Database
Backing up Core WordPress Files
Core WordPress files are the files that run your WordPress site. You normally would never make any changes to these files, so they remain the same on all WordPress sites.
The core WordPress files include all files in the root folder, wp-includes, and wp-admin folder.
You can always get fresh copes of these files from WordPress.org website. This is why you don’t always need to backup these files.
Backing up wp-content Folder
The wp-content folder is where WordPress stores all your images, media, themes, and plugins. The contents of this folder are unique to your website.
If you know what plugins and theme you had installed on your WordPress site, then you can always get fresh copies of these plugins and themes from their sources. In that case, you don’t need to backup plugins and themes folders.
If you can’t remember all the plugins or the theme you had installed, then you should backup these folders too. If you have a custom theme, then definitely backup these folders.
All your images and uploads go into /wp-content/uploads folder. If you lose this folder, then you will not be able to recreate it. You must always backup this folder.
The wp-content folder is also the place where your other WordPress plugins may create their own folders.
However, plugins like Envira Gallery create folders to store files for your galleries. You must backup these folders.
You need to make sure that files that you have uploaded using plugins are not excluded from backups.
Backing up WordPress Configuration Files
The WordPress configuration files contain important settings information for your WordPress website. The two most important WordPress configuration files are:
These files contain settings that are relevant to your WordPress site. They can be manually recreated, but it is safe to always add them to backups.
Backing up WordPress Database
WordPress stores all the data in a MySQL database. This is where all your posts, pages, users, comments, and everything else is stored.
This is the most frequently updated part of your WordPress site. This is why you need to create database backups more frequently.
Why Not Just Backup All The Files and Database Everytime?
You should create a full backup of all your WordPress files and database at least once a month. For busier websites, you can create full backups once a week or even once a day.
However, you need to keep in mind that creating full backups is resource intensive. If you are on shared WordPress hosting, then this could hog your server resources. It may result in a slow website or may even make your site inaccessible.
Storing large backup files on the cloud would take up your storage space. Transferring large files can also be difficult for shared server, which may result in unfinished uploads or corrupt backups.
Having said that, let’s see what should be an ideal strategy to backup your WordPress site?
Create Multiple WordPress Backup Schedules
The best way to setup a backup is by using multiple schedules. You can create multiple backup schedule like this:
- Full WordPress backup each month
- Partial WordPress backup every week
- Database only backup every day
Most good WordPress backup plugins allow you to setup multiple schedules. We will show you how to do that in BackupBuddy. For other plugins, check their documentation for instructions.
If this is your first time using BackupBuddy, then it will automatically take you to quick setup wizard.
Follow the on-screen instructions and BackupBuddy will create your first complete backup.
After that come back to BackupBuddy » Backups page. You will notice two buttons for database-only and complete backups.
Click on the plus icon next to them to add a new backup profile.
Next, you will you see two fields. Choose ‘Files only’ from the dropdown menu and then provide a name to this backup profile, e.g. Partial Backup.
After that you need to click on the gear icon next to your newly created profile.
This will bring up a popup where you can customize how this profile creates backups.
First you need to uncheck the box next to ‘Use global defaults for files to backup?’ option. This will show you WordPress files and folder structure.
Simply take your mouse to folder and files you want to exclude, and then click on the minus button. Repeat to improve wp-includes and wp-admin folders, files in root folder, and plugin created files inside wp-content folder.
Click on the Save profile settings button when you are done.
Now you need to visit BackupBuddy » Schedules page to add a new schedule.
Give this schedule a name and then select your backup profile. After that you can choose a backup interval. BackupBuddy lets you choose from a range of options starting from once hourly to once yearly.
For partial files backup, we recommend once or twice a week schedule.
Click on the remote destination button to select where to save the backup. Click on the add new schedule button to save your changes.
That’s all, BackupBuddy will now create a partial backup of your files based on the schedule defined by you.
You can add more schedules and backup profiles to make sure that your backups are not too bloated, can be reliably moved, and easily restored.
We hope this article helped you learn which WordPress files should you backup? And the right way to do it. You may also want to see our 13 vital tips and hacks to protect your WordPress admin area.