WordPress glossaryA WordPress backup is a copy of a site's files and database, kept somewhere else, so the site can be restored after a mistake, a hack, or a failed update.
A WordPress backup is a complete copy of a site, taken at a point in time and stored somewhere other than the site's own server, that can put the site back exactly as it was. It is what turns a bad update, a deleted page, a hacked site, or a failed server from a disaster into an hour's work. Backups are also how sites move: copying a site to a new host or to a staging environment is, in practice, restoring a backup somewhere else.
What a backup must include
A WordPress site has two halves, and a backup needs both.
- The database holds posts, pages, comments, users, settings, menus, and, on a store, orders and customers.
- The files are WordPress core,
wp-config.php, any.htaccessrules, and thewp-contentfolder with themes, plugins, and the uploads folder, which holds every image and document in the media library.
Core files can be downloaded again from WordPress.org, so some backup tools skip them. Everything else is unique to the site. A database without its uploads restores pages full of missing images; uploads without the database restore nothing at all.
WordPress has no built-in backup. Tools, then Export creates an XML file of posts, pages, and other content, which is useful for moving content, but it does not include themes, plugins, settings, or the media files themselves.
Types of backup
- Full: everything, every time. The simplest to restore, but slow and heavy for large sites.
- Incremental: only what changed since the last backup of any kind. Fast and light, which allows frequent or near-real-time backups, but a restore needs the last full backup plus every increment since.
- Differential: everything that changed since the last full backup. Restores need only two pieces, but each differential grows until the next full backup.
- Partial: just the database, or just the uploads. Handy before a risky change, but not a substitute for a full backup.
How often, and how long to keep them
Back up as often as the site changes. A brochure site edited once a month is fine with daily or weekly backups. A busy blog needs daily ones. A WooCommerce store takes orders around the clock, and restoring last night's database would erase every order since, so stores need frequent incremental or real-time database backups. Always take a fresh backup right before updates or any significant change.
Keep several generations, not just the latest. A hack or a corrupted plugin can go unnoticed for weeks, and if every backup was taken after the damage, none of them helps. A common pattern is daily backups kept for a month, plus weekly or monthly ones kept longer.
Where to store them
A backup stored only on the same server as the site disappears with it. The 3-2-1 rule is a good standard: three copies of the data, on two different kinds of storage, with at least one off site. For most sites that means the host's own backups plus a copy sent automatically to separate cloud storage such as Amazon S3, Backblaze B2, Google Drive, or Dropbox.
Most managed WordPress hosts take daily backups and offer one-click restores. They are a good first line, but check how long they are kept, whether you can download them, and whether they would survive a problem with your hosting account itself. A second, independent copy is cheap insurance.
Treat backup files as sensitive. They contain wp-config.php with the database password, plus every user's email address. Never leave a backup archive in a public folder on the web server, where anyone who guesses the file name can download it.
How to back up WordPress
With a plugin. UpdraftPlus, BackWPup, BlogVault, Duplicator, and others schedule backups, send them to cloud storage, and restore them from the dashboard. Some also handle migrations. Pick one that supports incremental backups if the site is large or changes often.
With the host. Check the hosting dashboard for automatic backups, their frequency, and on-demand snapshots.
By hand. Download the files over SFTP or the host's file manager, and export the database with phpMyAdmin or, over SSH, with WP-CLI:
wp db export ~/backups/backup.sql
tar -czf ~/backups/site-files.tar.gz wp-content wp-config.php .htaccess
Both commands write to a folder outside the web root; download the files, then delete them from the server.
Restoring, and testing restores
A restore puts the files back, imports the database, and checks that wp-config.php points to the right database. Plugins and hosts usually do this in one step; by hand, it means uploading the files and running wp db import or a phpMyAdmin import. After restoring a hacked site, change every password and update everything, or the attacker can walk straight back in.
A backup is only as good as its last successful restore. Every so often, restore a backup to a staging site and click around: pages load, images appear, forms work, and you can log in. That is the only way to know the backups you are paying for actually work. We cover the restore process in more depth in our backup and restore tips.