Resilience
How to Restore a WordPress Website From Backup
A careful restore process for WordPress files, databases, credentials, testing, and recovery verification.
Updated July 2026 · 12 min readHow to restore a WordPress website from backup: the safe order
To restore a WordPress website from backup, begin by identifying what failed and which recovery point is safe. A normal WordPress site is assembled from two distinct parts: files and a database. The files include themes, plugins, uploads, configuration, and other code. The database holds posts, settings, users, comments, and plugin data. Restoring only one side can produce missing media, broken layouts, login failures, or data from two different moments.
Treat the matching files and database export as one backup set. WordPress documentation describes restoring the files before importing the database as a typical order, then updating wp-config.php if database credentials changed. A host or backup plugin may automate those steps differently, so follow the documented procedure for the tool that created the backup. The goal is consistency, not forcing every recovery through the same interface.
- Record the incident and the time the problem first appeared
- Choose a backup created before that time
- Confirm that the set includes both WordPress files and database data
- Restore away from the public site before changing production
Contain the problem before restoring anything
A restore is not automatically the first action. If the site is compromised, preserve useful evidence and stop the attacker from continuing to change data. If an update failed, note the WordPress, theme, plugin, and PHP versions involved. If content was deleted accidentally, determine whether new orders, form submissions, comments, or account changes arrived after the selected backup.
Take a separate snapshot of the current broken state when it is safe to do so. That snapshot is not the recovery source; it preserves logs, recent uploads, transactions, or configuration that may need investigation or selective recovery. Avoid repeatedly clicking restore buttons on production. Each uncontrolled attempt makes the final state harder to explain.
Choose a known-good recovery point
The newest backup is not always the safest. A compromised site may have been infected before anyone noticed, and a damaged database may already be present in several recent snapshots. Use logs, monitoring, release records, and the incident timeline to identify the newest copy that predates the failure.
Verify that the backup can be opened and that its parts belong together. Look for a database export plus wp-content, wp-config.php, uploads, themes, and plugins appropriate to that date. Keep the original archive unchanged. Work from a copy so a failed extraction or accidental edit cannot damage the only recovery material.
Restore into an isolated environment first
Use a staging site, temporary hostname, local environment, or access-restricted server. Prevent search indexing and avoid sending real customer emails or scheduled notifications from the restored copy. If the database contains private customer or user data, give the test environment the same access discipline as production.
Restore the site files and then import the matching database according to the backup system's instructions. Confirm database connection details in wp-config.php. If the hostname or directory changed for testing, use a WordPress-aware migration method for URL changes because serialized values can be damaged by an unsafe text replacement.
Test the recovered WordPress site as a business system
A homepage that loads is not proof of recovery. Sign in with an authorized test account, open representative posts and pages, and inspect recent media. Test navigation, search, forms, checkout or booking flows, transactional email, scheduled jobs, redirects, analytics tags, and any external services the site depends on.
Compare the recovery point with the incident timeline. Document which changes were lost between the backup and the failure. Recover newer content selectively only when its source is trustworthy and the import will not reintroduce the original problem. Record the time required so the next recovery plan reflects evidence instead of an estimate.
- Administrator login and least-privilege user access
- Homepage, one article, one media-heavy page, and the main conversion path
- Forms, payments, bookings, email delivery, and scheduled tasks
- HTTPS, canonical URLs, redirects, robots directives, and sitemap
- Backup job and monitoring after recovery
Fix the cause before returning traffic
If an update caused the failure, resolve the incompatible component and repeat the test. If credentials or software were compromised, update WordPress, active themes, and plugins from trusted sources; remove abandoned components; rotate affected credentials; and review administrator accounts and file changes. Restoring an old copy without closing the entry point only resets the clock.
Move the verified recovery to production or switch traffic using a documented rollback plan. Keep the previous environment available but isolated until the new site has completed real checks. Monitor errors, forms, orders, email, resource use, and security signals after reopening.
Turn the restore into a repeatable recovery plan
Set backup frequency from acceptable data loss, not from a generic schedule. A brochure site that changes monthly and a store taking orders every minute need different recovery points. Keep at least one protected copy outside the hosting account so one account failure cannot remove both production and recovery data.
Assign an owner, document where backups and credentials live, and schedule a test restore. The test should produce a dated result, the measured recovery time, any missing components, and the next correction. A backup dashboard that says successful is useful evidence of a copy; only a restore test shows whether the business can recover.
Sources and further reading
Related guides
Practical checklist
- Preserve evidence before changing a compromised site
- Choose a known-good files-and-database backup set
- Restore in an isolated environment first
- Verify login, pages, forms, email, jobs, and integrations
- Fix the original cause before reopening traffic
- Rotate affected credentials
- Record the recovery point and test result