To back up a WordPress site properly, copy both the files and the database, keep at least one copy away from your hosting server, and restore a backup to a test site now and then to prove it works. A backup you have never restored is only a hope. This guide shows what to back up, how often, four ways to do it and how to test a restore.
The short version
- Back up the files and the database, not just one.
- Keep one copy off the server, in an account you control.
- Back up daily if the site changes daily, and always before updates.
- Keep several restore points, not a single copy.
- Test a restore on a staging copy so you know it works.
What a complete WordPress backup contains
A WordPress site has two halves. Files alone will not rebuild it, and a database alone loses your images and design. A complete backup includes:
- The database: posts, pages, settings, users and, on a store, orders.
- The wp-content folder: your themes, plugins and uploaded images.
- Configuration files: wp-config.php and .htaccess.
The 3-2-1 rule in plain words
Keep three copies of your data, on two kinds of storage, with one copy off-site. For a small business site that can mean the live site, a backup on your host and a backup in a separate cloud account that you control.
Why off-site matters
If the only backup sits on the same server as the site, one problem can take both: a hack, a server failure or a suspended hosting account. Store at least one copy with a different provider, protect that account with a strong password and two-step login, and make sure you can reach it without logging in to your website.
How often should you back up a WordPress site?
Match the schedule to how often the site changes:
- Brochure site: weekly, and after any change.
- Blog or active site: daily.
- Online store: daily for files and more often for the database, so you do not lose orders.
- Always: before updating WordPress, a theme or a plugin, and before a redesign.
Keep several weeks of restore points. If a problem is noticed late, you need a copy from before it began.
Four ways to back up WordPress
1. Your host’s backups
Easy and often automatic, but usually stored in the same hosting account. Check how long they keep copies and how a restore works.
2. A backup plugin
Plugins can schedule backups and send them to cloud storage. Check that yours handles your site size and that it can restore, not only create files.
3. A manual backup
Copy the files over SFTP and export the database with phpMyAdmin or WP-CLI. It is good before a big change, but too easy to forget as a routine.
4. A managed service
Someone sets up off-site backups, monitors them and tests restores for you. This is part of our WordPress maintenance and support plans.
How to back up WordPress with a plugin
A backup plugin is the easiest routine for most site owners. The exact screens differ between plugins, but the steps are the same:
- Install one reputable backup plugin from the WordPress plugin directory or a trusted developer, and keep it updated.
- Choose what to include: the database, plugins, themes and uploads.
- Set a schedule that matches how often the site changes.
- Connect remote storage, such as a cloud storage account that is separate from your hosting.
- Run a first backup, then check that the files really appear in the remote storage.
- Turn on email alerts so you hear about a failed backup.
Do not rely on a green tick alone. Download a backup once and look inside it, or better, restore it on a test site as described below.
How to back up WordPress manually
A manual backup takes longer, but it needs no plugin and is useful before a large change:
- Connect to your hosting account with SFTP and download the whole WordPress folder, or at least wp-content, wp-config.php and .htaccess.
- Export the database. In phpMyAdmin, choose your WordPress database and use Export. If you have command-line access, WP-CLI can do it in one line.
- Name the files with the date and keep them in two places, one of them off your computer and off your host.
wp db export backup.sqlTo import a database file later, the matching WP-CLI command is wp db import. Always do this on a test copy first.
How to test a WordPress restore
Test on a separate copy, never on the live site:
- Create a staging, local or subdomain test site.
- Restore the files and the database from your backup.
- Update the site address if the test site uses a different one.
- Log in and open your key pages. Check images, forms and, on a store, the checkout.
- Note how long it took and what broke, then fix the process.
Repeat this every quarter, and after changing host or backup plugin. Tests often catch incomplete files, timeouts on large databases and plugin conflicts, which you would otherwise discover during an emergency.
How to restore a WordPress backup
When something goes wrong, work calmly and in this order:
- Put the site in maintenance mode if visitors are affected.
- Take a backup of the broken site as it is now. You may need something from it later.
- Restore the database and the files from the same backup point, or use your plugin or host restore tool.
- Clear your caches, including any CDN, then log in and check key pages, forms and checkout.
- If the cause was a hack, change every password and key, and update everything before you reopen the site.
Restoring an old copy overwrites newer content. On a site that takes orders or comments, think about what you might lose between the backup and today.
Backups for online stores and large sites
A store changes all day, because every order, stock change and customer account is saved in the database. Restoring an old database can erase recent orders, so stores usually back up the database much more often than the files, and check how orders would be recovered. Very large sites with big media libraries can hit time or memory limits during a backup or restore. If your backups regularly fail or never finish, ask your host about the limits or move to a tool that backs up in smaller pieces.
Common WordPress backup mistakes
- Storing the only backup on the same server as the site.
- Backing up the database but not the uploads, or the other way round.
- Never testing a restore.
- Keeping only the latest copy.
- Not knowing where the backups are or who can access them.
Backups and hacked sites
A backup taken after a site was infected can bring the infection back when you restore it. Keep older restore points and scan a backup before using it. If your site may already be hacked, start with our first-hour checklist. If you want it cleaned for you, see our WordPress malware removal service.
WordPress backup FAQs
Do I need a backup plugin if my host already backs up my site?
Host backups help, but they are often in the same account as the site and you may not control retention. An extra off-site copy protects you if the host account is lost or suspended.
How long should I keep backups?
Keep several weeks of restore points so you can go back to before a problem started. Busy stores may want more frequent copies.
Can I restore only the database or only the files?
Often yes, but it depends on the tool. Restoring only part of a site can leave the files and database out of step, so test it first on a copy.
Is a backup the same as security?
No. A backup helps you recover, but it does not stop an attack. Read our WordPress security checklist for prevention, and our maintenance checklist for a routine schedule.
Where should I store WordPress backups?
In a separate account from your hosting, ideally with a different provider and its own strong password and two-step login. Keep one copy you can reach even if your website is down.
How do I know my backup worked?
Check that the backup file exists, that it is not empty, and that it contains both the files and the database. The only real proof is a test restore.
What does a restore overwrite?
A full restore replaces the current files and database with the saved versions, so anything added after the backup is lost. That is why you back up the current state before restoring.
Can you handle the backups for me?
Yes. Our WordPress maintenance and support plans include off-site backups and tested restores. Send the contact form and we will reply with the next steps.
