Pick the right restore point

Choose the newest backup from before the failure or infection. A newer infected backup will bring the problem back.

If you are not sure when the problem started, look for the earliest sign rather than the day you noticed it: the first odd entry in access logs, the modification date of a suspicious file, or the date a plugin update was applied. Many infections and bad updates sit unnoticed for days, so the "newest" backup is not automatically the right one.

Timeline showing how to choose a WordPress backup restore point from before the infection started
Pick the newest clean backup, not simply the newest backup.

Restore order

Usually: files first or together with database, then wp-config alignment, then permalinks flush.

Restoring files without the matching database, or the other way round, is a common cause of broken layouts and missing media after a restore. If your backup tool stores them separately, check that both come from the same date before you begin.

Six-step WordPress restore order: restore files, import the matching database, align wp-config.php, update URLs, flush permalinks and clear caches
Work in this order so files, database and configuration all agree with each other.

Verify critical journeys

Homepage beauty is not enough. Check login, forms, carts, LMS, and admin screens.

Checklist for verifying a WordPress site after restoring from backup, covering login, forms, checkout, cron, email and mobile
Test the journeys that make money or generate leads, not just the homepage.

If backups are missing or incomplete

Partial recovery may mean rebuilding from a public crawl, staging copies, or hosting snapshots. Prevention matters more after this happens once.

Before rebuilding anything, ask your host whether they keep their own server snapshots. Many do, even on plans that do not advertise backups, and they may be able to restore files or a database from a specific date. Public copies of your pages can help you recover text, but they will not contain your database, users or orders, so treat them as a last resort for content only.

Illustration of scattered website fragments being reassembled during a partial WordPress recovery without a full backup
Partial recovery is slow work, which is why off-site backups should start the same day.

Connect restore to security

After a hack restore, still rotate credentials-attackers may still have passwords.

A restored copy of a hacked site still has the same weakness that let the attacker in. Update or remove the vulnerable plugin, rotate passwords, and generate new security keys before you reopen the site. The full order of work is in how to clean a hacked WordPress site.

Illustration of a padlock receiving a new key, representing rotating credentials after restoring WordPress
A restore puts the files back; rotating credentials takes the attacker's access away.

What should a usable WordPress backup contain?

A WordPress site has two halves, and a backup needs both. The database holds posts, pages, users, settings, orders and form entries. The files hold WordPress core, themes, plugins, wp-config.php and the wp-content/uploads folder with your media. A backup that only covers one half will not give you a working site.

The WordPress.org backup documentation suggests keeping several recent backups in different locations, and backing up before every upgrade. How often you back up depends on how much you change: a brochure site may be fine weekly, while a shop or membership site with daily orders needs at least daily database backups.

How do you restore WordPress with WP-CLI?

If your host gives you SSH access, WP-CLI makes the database side of a restore quicker and more predictable than uploading through phpMyAdmin. A typical sequence, after copying the files back into place, looks like this:

Never run a search and replace on a live database without a fresh export. A wrong pattern can break serialised data across the whole site. Export first, dry-run second, and only then run it for real.

What if the restore fails halfway?

Restores fail for ordinary reasons: an upload times out, the database file is larger than phpMyAdmin allows, or the archive was only partly written when the backup ran. Stop rather than retrying blindly, and go back to the broken-state copy you took at the start so you are never worse off than when you began.

Check the size of the backup archive and database file against earlier backups. A file that is much smaller than usual is a warning sign that something was skipped. If an import times out, ask your host to import the database for you or use WP-CLI over SSH, which avoids browser upload limits. If the archive itself is corrupt, move to the next oldest clean backup and accept losing a little more recent content rather than restoring something you cannot trust.

Keep the site in maintenance mode until the restore is complete and checked, so visitors and search engines do not see a half-restored version.

How do you test your backups before you need them?

A backup you have never restored is a hope rather than a plan. Once a quarter, or after any major change, restore your latest backup to a staging site or a local environment and click through the same checks you would use after a real incident. You will find out whether the export is complete, whether the archive opens, and how long a restore actually takes.

Write the steps down while you do it: where the backups live, who has the login, and which order works for your host. That short document is what saves the most time during a real outage. If the site goes down and you are not sure whether a restore is the right move, my WordPress site down emergency checklist helps you decide.

Frequently Asked Questions

Will restoring a backup delete recent orders or posts?

Yes, anything created after the backup was taken will be lost from the restored database. Export recent orders, form entries or posts before restoring so you can re-enter or re-import them afterwards.

Can I restore only the database or only the files?

Sometimes. A bad plugin update can often be fixed by restoring only that plugin's files, and lost content may only need the database. For hacks, restore both from the same clean point so nothing infected is left behind.

How many WordPress backups should I keep?

Keep several recent backups in more than one location, including at least one off the server. The WordPress.org documentation suggests keeping three to five recent copies.

Why does my site look broken after a restore?

The usual causes are files and database from different dates, a wrong site URL, stale caches or missing uploads. Clear every cache, re-save permalinks and check that siteurl and home match the domain.

Do I still need to change passwords after restoring from a backup?

If the restore followed a hack, yes. The backup restores old passwords too, and the attacker may already know them. Rotate WordPress, hosting, database and email credentials and generate new security keys.

Final Thoughts

Restoring WordPress from a backup is straightforward when the backup is complete, recent and clean, and stressful when any of those is missing. Choose the restore point carefully, restore files and database together, and test the journeys that matter before you reopen the site. Then use the experience to tighten your backup routine, because the best time to test a restore is before you need one.

Need help applying this?

Need restore support now? See emergency recovery or hack cleanup.

Related service: Site down recovery · Contact · All articles

Official References

Sources checked on 29 October 2026: