Skip to content

How to restore a WordPress site from a backup, step by step

· The AYT team · 6 min read

Man typing on a laptop at a wooden table, with a phone and notebook beside it

Restoring a WordPress site from a backup means putting back the files, the database or both, from a moment when the site still worked. You pick the copy from before the problem, save the current state (even if it's broken), restore, and check what changed since. The fastest way is your hosting panel; if the backup was made with a plugin, restore from the plugin; otherwise, by hand, with FTP and phpMyAdmin.

Before you restore

Three things save you from surprises:

  1. Back up the current state. If the restore doesn't fix the problem or you pick the wrong copy, you can go back. This copy is also where you recover content written after the backup.
  2. Pick the right date. After an update that broke the site, take the backup from the day before. For a hacked site, go further back, to a date before the first signs of infection.
  3. Write down what changed between the backup and now: posts published, comments, new users and, for a store, orders. All of these disappear when you restore the database.

What to restore: the whole site or just part of it

You don't have to restore everything every time. The less you restore, the less you lose.

Problem What to restore
a plugin or theme update broke the site only the files (or only that plugin's folder)
you deleted a page or post by mistake only the database, or copy the content from the backup and add it back by hand
you deleted an image or a file only that file
the site was hacked the whole site, from a safe date, then close the hole
you broke the settings (menu, widgets, theme options) the database

On a WooCommerce store, restoring the database deletes the orders received after the backup. If the problem is only in the files, restore only the files.

Option 1: from your hosting panel

Most panels have a backup page where you pick the date and the site. The usual steps:

  1. Open the backup page in the panel.
  2. Pick the restore point (date and time).
  3. Pick the site and what to restore: the files, the database or both.
  4. Confirm and wait. For a typical site it takes a few minutes.

For a single file, many panels have a separate restore where you browse the folders in the backup and pick only what you need.

Option 2: with UpdraftPlus

If the backup was made with UpdraftPlus and the site still opens:

  1. Open UpdraftPlus from the wp-admin left-hand menu.
  2. In the "Existing backups" list, pick the date and click "Restore".
  3. Tick the components: plugins, themes, uploads, other files, database.
  4. Start the restore and wait for the final message.

If wp-admin doesn't open at all, install a clean WordPress (on the same host or another one), install UpdraftPlus, connect the same remote location (for example Google Drive) or upload the archives by hand with "Upload backup files", then restore as above. Restoring the database also replaces the users, so afterwards you log in with the password from the old site.

Option 3: by hand, with FTP and phpMyAdmin

When you have a files archive and an .sql file, made by hand or downloaded from the panel:

The files

  1. Upload the archive to the site's folder in the File Manager and extract it, or upload the files over FTP.
  2. If you restore only wp-content, rename the current folder first (for example to wp-content-old), so old and new files don't mix.
  3. Check that wp-config.php has the right database name, user and password for the server you're on now.

The database

  1. Open phpMyAdmin and select the site's database.
  2. Select all tables and choose "Drop", so the import doesn't fail on existing tables. Only do this after you've saved the current state.
  3. Go to "Import", choose the .sql (or .sql.gz) file and click "Go".
  4. Check in wp-config.php that $table_prefix matches the prefix of the imported tables.

If you restore to a different domain from the one in the backup, you also need to replace the addresses in the database. The steps are in the article on moving WordPress to a new domain.

After the restore: what to check

  • Open the home page and a few inner pages in a private window.
  • Log in to wp-admin.
  • Clear the caches: the page cache, the object cache (Redis) if you use one, and your caching plugin's. Otherwise you may still see the broken version.
  • Test the forms and, for a store, the cart and a test order.
  • Recover what was lost. Orders received after the backup are in the confirmation emails and in your payment processor's account; enter them again or keep a separate record.
  • If you restored after an attack, change every password and find out how they got in. Otherwise the site will be hacked again. See what to do with a hacked WordPress site.

If the site still doesn't work

If you get a 500 error or a blank page after the restore, read the error log: it usually names the file and line at fault. Common causes are a PHP version different from the one at backup time and a wrong database password in wp-config.php. The details are in the 500 error guide.

Restoring on AYT hosting

On AYT's paid plans you restore yourself from the panel's Backup page. You pick the restore point, then the whole site or just a few files; for a site you choose the files, the database or both.

Restoring files and folders from a backup

Backups run daily. We keep the last 7 days, one backup a week for the last 4 weeks and the last backup of each month for 24 months, in 3 locations. So you can go up to two years back, which helps when an attack is found late. How to choose what to save and how often is in the WordPress backup guide. The plans are on the WordPress hosting page.

More articles

All articles