Skip to content
HOSTIGAN
WordPress

How to back up and restore WordPress (files and database)

Back up WordPress the right way: what to include, hosting vs. plugin vs. manual backups, the 3-2-1 rule, and how to restore and test a backup before you need it.

Beginner 5 min read Updated November 24, 2026

A backup you've never restored is a hope, not a plan. WordPress sites break for ordinary reasons — a plugin update that clashes with your theme, an accidental deletion, an expired payment that takes the hosting offline, or a hacked admin account. With a solid backup, each of those is a short annoyance instead of a disaster. This guide shows you what a complete WordPress backup includes, the three ways to make one, how often you need it, and how to restore and test it.

What a complete WordPress backup contains

WordPress is two things stored in two places, and you need both:

PartWhere it livesWhat's in it
DatabaseMySQL/MariaDBPosts, pages, comments, users, settings, orders, menus
Filespublic_html (or your site folder)wp-content/uploads (media), themes, plugins, wp-config.php, .htaccess

Core WordPress files can always be downloaded again, so the important parts are wp-content, wp-config.php, .htaccess and the database. A backup with only files gives you an empty site; a backup with only the database gives you text without images.

Three ways to back up WordPress

1. Hosting backups

Most hosts keep their own backups of your account, and many cPanel hosts let you browse and restore them yourself. These have the big advantage of working even when WordPress itself is broken, because they live outside the site. Our guide on backups in cPanel shows how to create and download a full or partial backup from the control panel.

2. Backup plugins

Plugins such as UpdraftPlus, BackWPup or Duplicator run inside WordPress, on a schedule, and can send copies to external storage like an S3-compatible bucket, Google Drive or Dropbox. They're easy to set up and give you off-site copies automatically. Their weakness: if WordPress won't load, the plugin can't run either — but your stored copies are still usable.

3. Manual backups

For a one-off backup before a big change, you can do it yourself. In cPanel: export the database with phpMyAdmin (Export → Quick → SQL) and compress public_html in File Manager, then download both. With SSH and WP-CLI it takes two commands:

cd ~/public_html
wp db export ~/backups/db-$(date +%F).sql
tar -czf ~/backups/files-$(date +%F).tar.gz -C ~/public_html .

You can schedule the same commands with a cron job — just remember to clean up old archives so they don't fill your disk.

Comparing the methods

Hosting backupPluginManual
AutomaticYesYesNo (unless scripted)
Works when WordPress is brokenYesRestore only from stored copiesYes
Off-site copyDepends on hostYes, if configuredIf you download it
Server loadNone for youSome, during the runBrief
Best forEveryday safety netOff-site historyBefore updates or moves

The best setup combines at least two of them.

The 3-2-1 rule applied to WordPress

The classic rule is: 3 copies of your data, on 2 different types of storage, with 1 copy off-site. For a typical WordPress site that might look like this:

  1. The live site itself.
  2. Your host's backups.
  3. A plugin or script sending copies to external cloud storage you control.

Tip: Make sure at least one copy is stored with a different company than your hosting. If you lose access to the account, you don't want to lose the backups along with it.

How often should you back up?

Ask yourself how much work you could tolerate losing. Some rough guidelines:

  • Brochure site, rarely changed: weekly, plus before every update.
  • Active blog: daily.
  • Webshop or membership site: database at least daily, ideally several times a day; files daily.

And always take an extra backup right before updating WordPress, changing themes, switching PHP versions or running a database clean-up.

How to restore WordPress

From a hosting or plugin backup

  1. Back up the current state first, even if it's broken. You might need something from it.
  2. Choose a restore point from before the problem started.
  3. Decide what to restore: database only, files only, or both.
  4. Run the restore, then clear any cache (plugin, server and CDN).
  5. Check the front page, a few inner pages, the login and — on a shop — a test order.

Manually

  1. Upload and extract the file archive into the site folder.
  2. In phpMyAdmin, select the database, drop the existing tables (or create a new, empty database) and import the .sql file. See our guide to MySQL databases in cPanel.
  3. Check that DB_NAME, DB_USER and DB_PASSWORD in wp-config.php match the database.
  4. Log in and go to Settings → Permalinks and click Save — this rewrites .htaccess and fixes most 404 errors on inner pages.

With WP-CLI, the database import is a single command:

wp db import ~/backups/db-2026-11-20.sql
wp cache flush

Warning: Importing a database overwrites everything in it. Anything added after the backup — new orders, comments or users — will be gone unless you saved it first.

Test your backups

Every few months, prove your backup works. Restore it to a test subdomain such as test.example.com, check that pages, images and logins work, block search engines from indexing the copy (Settings → Reading), and delete it when you're done. If you ever need to move the site to new hosting, the same skills apply — see how to move WordPress.

Common backup mistakes

  • Backing up only files. Without the database, you have themes and images but no posts, pages, users or orders.
  • Keeping every copy on the same server. If the account is suspended, hacked or the disk fails, the backups go with it.
  • Never checking the archives. A backup job can fail silently for months. Open the plugin's log or your backup folder now and then, and confirm the newest file is recent and not suspiciously small.
  • Restoring over the only copy. Always take a fresh backup of the current state before you restore — even a broken site may contain the order that came in an hour ago.
  • Forgetting wp-config.php. Many plugins skip it by default. Without it you'll have to recreate the database credentials and security keys by hand.
  • Leaving backups in the web root. An archive in public_html can be downloaded by anyone who guesses the name, including your database password. Store backups outside the public folder.

In short

Back up both the database and wp-content, use at least two methods, keep one copy away from your host, back up before every major change, and test a restore regularly. Then a broken update is a ten-minute fix.

Backups at Hostigan

Hostigan's WordPress hosting includes staging on WP Pro and up, so you can test updates on a copy before they touch the live site — the safest moment to discover a bad update. If you run WordPress on a VPS, snapshots on VPS Plus and up give you a quick rollback point before big changes. Either way, keep your own off-site copy too.

Frequently asked questions

As often as you can afford to lose work. A blog updated weekly can live with daily backups; a webshop taking orders all day needs at least daily database backups, often more, plus an extra one before every update.

Next in “WordPress that performs” · 6 of 7How to move your WordPress site to a new host (no downtime)