How to Restore WordPress from a Backup
To restore WordPress from a backup, put the files back first, then the database. In cPanel, extract the backup archive into public_html with File Manager, then import the .sql dump into the site's database in phpMyAdmin. If wp-admin still opens, a backup plugin's own Restore screen is faster. Export anything newer than the backup before you start.
For WordPress owners rolling back a broken update, recovering deleted content or rebuilding a hacked site from an earlier copy.
knowledge
- Read time
- 5 min
- Sections
- 6
- Updated
- 14 Nov 2026
- Written by
- WebJi® team
Last editorial update: 14 November 2026.
Before you restore: decide what to bring back and save what is new
A restore returns the site to the backup's date, so anything written after it, including orders, form entries, comments and new users, is replaced unless you export it first. Spend five minutes deciding exactly what is broken and what must survive.
| What went wrong | Restore | Keep |
|---|---|---|
| Plugin or theme update broke the site | Files (that plugin/theme folder) | Current database |
| Content deleted or settings ruined | Database only | Current files |
| Site hacked | Files and database from before the compromise | Export of new orders/leads to re-enter |
| Moving to a new server | Files and database, then fix wp-config.php | Nothing from the old server |
- Snapshot the broken site: export the current database and download
wp-content, so you can go back if the restore is worse. - Check the backup: its date, and whether it contains files, database or both.
- Stores and subscriptions: pause automatic renewals first; a rolled-back database can make already-paid periods look unpaid.
- Hacked sites: choose a backup from before the first sign of compromise, or the backdoor comes back with it; see fixing a hacked WordPress site.
Restoring from a backup plugin inside wp-admin
If wp-admin still opens and the backup was made by a plugin, use that plugin's restore screen; it unpacks each component and handles paths for you.
- UpdraftPlus: Settings → UpdraftPlus Backups → Backup/Restore → Existing backups → Restore. Tick database, plugins, themes, uploads or others as needed and confirm.
- Jetpack VaultPress Backup: Jetpack → Backup (or the Jetpack cloud dashboard), choose a point in time, then Restore. Large sites can take a while and you are emailed when it finishes.
- Partial restores: untick the database to roll back files only, or restore only the database when an update broke settings.
If wp-admin is down, many plugins can still restore from their remote storage when you install a fresh WordPress and the same plugin. Plugin choice is compared in WordPress backup plugins.
Restoring WordPress files in cPanel File Manager
Upload the archive to the site's document root, extract it over the existing files, keep the live wp-config.php if the database details changed, and reset permissions to 644 for files and 755 for folders.
- In File Manager, open
public_html(or the addon domain's folder) and turn on Settings → Show Hidden Files so.htaccessis visible. - Upload the
.zipor.tar.gzand choose Extract; accept the overwrite. - If the backup's
wp-config.phppoints to a database name, user or password that no longer exists, put the live one back. - Set permissions: 644 for files, 755 for folders, never 777.
- Delete the archive from the web root so nobody can download it.
If the host has full-account backups, cPanel's Backup or a backup tool provided by the host can restore files and databases without uploading anything; see cPanel backup and restore.
Restoring the WordPress database in phpMyAdmin or over SSH
Import the .sql or .sql.gz dump into the database named in wp-config.php; a dump with DROP TABLE statements replaces the existing tables automatically.
- cPanel → phpMyAdmin → select the database in the left column → Import.
- Choose the dump, leave the format as SQL and click Import.
- If it fails with "table already exists", the dump lacks
DROP TABLE; drop or rename the current tables first. - If the file is over the upload limit, use the compressed
.sql.gz, cPanel's "Restore a MySQL Database Backup", or the methods in importing a large SQL file.
# over SSH, from the WordPress folder
wp db export before-restore.sql # safety copy of the broken state
wp db import backup-2026-11-01.sql
# compressed dump straight into MySQL
zcat backup-2026-11-01.sql.gz | mysql -u DB_USER -p DB_NAME
wp cache flush
If the backup came from a different domain or staging copy, run wp search-replace 'https://old.example' 'https://www.example.in' --skip-columns=guid afterwards; the reasons are in changing the WordPress site URL.
How to confirm the WordPress restore worked
Run five checks in order and stop at the first failure: home page, admin login, permalinks, a recent post with an image, and a clean error log.
- The home page loads with no PHP warning or white screen.
/wp-adminaccepts the password that existed on the backup date.- Settings → Permalinks → Save Changes reports "Permalink structure updated."
- A recent post and one image from
wp-content/uploadsopen. - No new lines appear in cPanel → Metrics → Errors after reloading.
Then change the admin password, update WordPress core, themes and plugins, and re-enter any orders or leads you exported before starting.
When a WordPress restore fails: symptoms and fixes
Most failed restores come from six causes, and the message on screen usually points to the right one.
| What you see | Likely cause | Fix |
|---|---|---|
| "Error establishing a database connection" | wp-config.php credentials do not match the database | Check DB_NAME, DB_USER, DB_PASSWORD, DB_HOST |
| 500 error after files go back | Permissions or an .htaccess from another server | Reset 644/755; rename .htaccess, reload, re-save permalinks |
| Redirects to an old or staging domain | siteurl and home hold the old address | Update both, or set WP_HOME/WP_SITEURL |
| Plugin says restore did not complete | Disk full, PHP memory or time limit | Free space, raise memory_limit, restore one component at a time |
| Import stops: file too large | PHP upload or post size limits | Use .sql.gz, cPanel restore or WP-CLI |
| Login loops | Old cookies or restored users table | Clear cookies; sign in with the backup-era password |
If there is no usable backup, a managed WordPress website backup service keeps scheduled copies off the server for next time, and the 3-2-1 backup rule explains how many copies to hold. On a WebJi® plan, email support@webji.services with the domain and the date you want back; support replies 24/7 in Hindi and English and confirms what your plan retains before changing anything.
Frequently asked questions
Should I restore the files or the database first?
Files first, then the database, checking in between that wp-config.php points to the database you are about to import. In practice either order works if both finish before you test, but files-first avoids a period where the database expects plugins that are not yet present.
Can I restore a single post or page instead of the whole site?
Yes. Import the backup into a separate, temporary database or a staging site, copy the post content out, and paste it into the live site. Recently deleted posts may also still be in Posts → Trash, which keeps them for 30 days by default.
My backup is a .wpress or .daf file. How do I restore it?
Those formats belong to specific migration plugins and are not plain archives. Install WordPress, install the same plugin and use its import screen. For manual restores you need a standard archive of files plus a .sql database dump.
How often should I test that my backups restore?
At least every few months, and after any change to the backup tool. Restore to a staging subdomain and run the five checks above. A backup that has never been restored is an assumption; scheduling is covered in how often to back up a website.
Checked 15 November 2026 against WordPress, WP-CLI and cPanel documentation · Reviewed by the WebJi® team, Jaipur.
Ready to get started with WebJi®?
Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.