Partial WordPress Restore: Single File or Database Only

Short answer: yes, you can restore part of a WordPress site instead of all of it. A partial WordPress restore of a single file means taking that one file out of your backup archive and uploading it back to the same place, which touches nothing else. Restoring only the database is different: according to the WordPress handbook, importing a database backup replaces your current database and reverts it to the state it was in when you backed up, so every post, comment, order or setting added since then is lost unless you save it first.

Written against WordPress 7.1.2. Last verified: September 27, 2026.

Before you restore anything: back up what you have now

A partial restore overwrites something. If you overwrite the wrong file, or import the wrong database, the version you had a minute ago is gone unless you copied it first. So before any step below:

  1. Take a fresh backup of the site as it is right now, broken parts included. Files and database. This is your undo button for the restore itself.
  2. Confirm the backup you are restoring from is the right date and opens properly.
  3. Write down exactly what you are going to replace, file by file or table by table.

If a fresh backup is not possible because the site is completely down, stop here and use our guide to restoring a WordPress backup while the site is down instead, which covers the full restore in the right order. And if you have not got a habit of taking backups before risky changes, the five-minute ritual before any risky WordPress edit is the place to start.

Files or database: find out which half broke

The question "I don't want to undo the whole week for one mistake" usually has a precise answer once you know where the mistake lives. The WordPress Backups handbook describes a site as two parts: the files (WordPress core, themes, plugins, uploads, wp-config.php, .htaccess) and the database (stored separately, usually in MySQL or MariaDB). Each kind of mistake lives in one of them.

What went wrong Where it lives Smallest fix
You edited a post or page and want the old wording back Database Not a restore at all: use the post's revisions
You deleted a post or page Database Check Trash first; a database restore is the last resort
A theme file you edited now shows an error Files Restore that single file
.htaccess or wp-config.php was changed and the site broke Files Restore that single file
A plugin update broke something Files (and sometimes database) Roll back the plugin before restoring anything
An image was deleted from the server Files, plus a Media Library entry in the database Restore the file; the library entry may need re-adding
Settings, menus or many posts were changed by a bad bulk action Database Database restore, after saving newer content

Two rows on that table are not restores at all, and that is deliberate. For a wording mistake, WordPress keeps revisions of posts; our guide to visual revisions in WordPress shows how to compare and bring back an older version without touching your backup. For a plugin update gone wrong, rolling back the WordPress update safely is smaller and less risky than a restore.

How to restore a single file

This is the gentlest restore there is, because it replaces one file and leaves everything else alone.

Step 1: find the file in your backup

Open your files backup (usually a .zip or similar archive) on your computer. Navigate to the same path the file had on the server. For example, a theme file will be inside wp-content/themes/ and the folder for that theme.

Step 2: copy it out

Extract only that file to a folder on your computer. Do not extract the whole archive over anything.

Step 3: keep the current version

On the server, using your host's file manager or an SFTP program, download the current (broken) version of the file first, or rename it, for example by adding -broken to the end. Now you can put it back if the older one turns out to be wrong too.

Step 4: upload the backup copy

Upload the file from your backup to the exact same folder, with the exact same name. Then reload the site and check the part that was broken, plus the home page and the admin.

When a single file is not enough

Some files depend on each other. A theme or plugin is a set of files that expect to match. If you restore one file from an older version of a plugin into a newer version of that plugin, it may not fit. In that case restore the whole folder for that one theme or plugin, which is still far smaller than a full restore.

How to restore only the database

This is the partial restore with the biggest consequences, so read the warning before the steps.

The WordPress handbook's page on Backing Up Your Database (last updated January 14, 2026, read on September 27, 2026) states that restoring will replace your current database with the backup, reverting it to the state it was in when you backed up. Anything added since, posts, comments, form entries, users, orders, setting changes, disappears.

Step 1: save anything newer than the backup

Before importing, save what you would otherwise lose. For posts and pages, Tools > Export in the WordPress admin creates an export file you can import later with Tools > Import. For comments, orders and form entries, there may be no simple way to carry them across, which is exactly why this step comes before the import and not after.

Step 2: take the fresh backup

Yes, again. The fresh backup of the current database is how you undo a database restore that turns out to be the wrong one.

Step 3: import the backup

The handbook's steps for phpMyAdmin are: log in to phpMyAdmin, click Databases and select the database you are importing into, click the Import tab, click Browse and locate the backup file on your computer, make sure SQL is selected in the Format menu, then click Go. Many hosts open phpMyAdmin from their control panel. The same page also shows the command-line method for people who use it.

Step 4: check the site, then re-add newer content

Load the site and the admin. If you exported newer posts in Step 1, import them with Tools > Import. Then check a few recent pages, your menus and your settings.

What about restoring just one table?

A WordPress database is made of tables. The handbook notes that WordPress tables start with wp_ or whatever table prefix is set in your wp-config.php, and that a custom export in phpMyAdmin lets you choose specific tables. So in principle, a backup exported table by table lets you restore one table.

In practice, be careful. WordPress tables refer to each other. Posts, for example, have related information stored in other tables. Restoring one table to last week while its related tables stay at today can leave the two out of step, and the resulting problems are not always obvious at first. If you are not sure which tables depend on which, a full database restore after saving newer content (the steps above) is the safer choice, and your web host's support team can often help with the table question.

Keep dates matched when you mix and match

The WordPress Backups handbook says you need both files and database to fully restore a typical site, and that in a full restore you restore the files first, then the database. The general lesson for partial restores: when you restore one half, check that it still fits the other. A plugin restored to an older version may expect database settings from that older time, and a database restored to last week may refer to images uploaded since. Test what you restored before you move on.

What a partial restore cannot do

  • It cannot bring back what was never backed up. If the file or content was created after your last backup, a restore will not find it.
  • It does not tell you why something broke. If a file broke once, find the cause before it breaks again.
  • It is not a substitute for a full restore when the whole site is down. Partial restores are for one known problem on a site that otherwise works.

FAQ

Can I restore one file from a WordPress backup?

Yes. Open the files backup on your computer, extract only that file, keep a copy of the current version on the server, and upload the backup copy to the same folder with the same name.

Will restoring the database delete my new posts?

Yes, unless you save them first. The WordPress handbook says a database restore replaces your current database with the backup, so anything added since is lost. Export newer posts with Tools > Export before you import.

Can I restore only one database table?

It is possible if your backup lets you select tables, but WordPress tables depend on each other, so restoring one can leave data out of step. A full database restore after saving newer content is usually safer.

Should I restore a single post from a backup?

Usually not. Check the post's revisions or the Trash first. Posts live in the database, so a backup restore for one post would roll back the whole database.

Do I need a backup before doing a partial restore?

Yes. Take a fresh backup of the site as it is now, so you can undo the restore if you replace the wrong file or import the wrong database.

Wpnotar Editorial
Wpnotar Editorial
Articles: 73

Leave a Reply

Your email address will not be published. Required fields are marked *