Did you delete an image, overwrite a useful file, or lose a page’s text? You don’t necessarily need to restore the entire site. A full restore would also roll back orders, comments, forms, or changes made since the backup.
To restore a file from a WordPress backup without affecting the rest, first retrieve the item in an isolated copy. Then reintegrate it methodically into the live site. This granular restoration reduces risk but requires distinguishing files, media, and content data.
Start by protecting the site’s current state
Before making any changes, create a new full backup of the current site. That way you keep a rollback point if the targeted recovery creates duplicates, replaces a recent version, or breaks an important link.
Next choose the backup that still contains the item you’re looking for. Check its date, integrity, and contents. If you haven’t already done this check, consult this method for verify that a WordPress backup is complete and recent.
Restore that copy into a temporary environment separate from the public site. A staging environment works well. You can search there for the file or content without modifying current data. It’s also wise to testing a WordPress backup restore before an urgent situation.
Identify what you actually need to recover
An item visible in WordPress doesn’t always correspond to a single file. An image, for example, often combines an uploaded file, a media record, and metadata. Conversely, an article’s text is primarily content data.
| Lost item | Safest method |
|---|---|
| Theme, template, or stylesheet file | Extract and compare the file in the temporary copy, then restore only the validated file. |
| Image or media library document | Retrieve the file, re-upload if needed, then check its media record and placement in the content. |
| Post or page | First check revisions; otherwise copy the content from the temporary copy into the current item. |
| Content with custom fields or business plugin | Inventory the related data in the temporary copy and use the plugin’s export tool if available. |
Recover a single file without replacing the rest
For a specific file, open the backup archive or temporary copy. Locate its exact path and compare its contents with the version currently online. Don’t copy an entire folder when you’re looking for a single file.
Then keep a copy of the current file before replacing it. Transfer only the confirmed file, then clear any applicable cache. Finally check the pages or functions that depend on it, on desktop and mobile.
Beware of plugin and theme files
An isolated file can depend on other files or on a specific plugin version. If the lost item belongs to a plugin that has been updated since the backup, restoring an old file alone can create incompatibility.
So first compare versions in the temporary environment. If you can’t clearly explain the file’s role, ask your host or a qualified person for help. Restoring an entire folder is rarely the best first action.
Restoring an image or document from the media library
A WordPress image is more than its original file. WordPress treats media as a distinct content type, attaching a title, description, alt text and metadata. Images can also have multiple derived sizes for different display contexts, as explained in the documentation on attachments and their associated data.
First copy the original file from the backup. Then upload it to the current site’s media library if its media record no longer exists. This step recreates the necessary record and allows WordPress to generate the required image sizes. The official reference on attachment metadata confirms that WordPress creates the linked data, including applicable sub-sizes for images.
After uploading, restore the useful alt text, title, caption and description. Then edit the affected pages to select the new media. Do not assume the same filename will produce the same URL. WordPress may add a suffix or place the file in a different folder depending on context.
Finally, check the featured image, image blocks, galleries and direct links to the document. This precaution is particularly useful after attempting to clean the media library without deleting in-use files.
Restoring the text of a post or page
Before opening a backup, review the revisions for the post or page. WordPress saves revisions and lets you compare changes before restoring a revision. The WordPress documentation on revisions describes this feature and the restoration procedure.
If the desired version is no longer available, open the post in the staging environment. Copy its title, content, excerpt, categories, tags and featured image. First paste the text into a draft on the current site. You can then compare the two versions without immediately altering the existing publication.
Validate the blocks, links, images and your site’s SEO settings. When everything is consistent, update the current post rather than publishing a second, similar piece of content.
Why avoid direct import by default
WordPress export and import can help when you’re retrieving a complete set of content with its taxonomies and fields. However, the importer is mainly meant to add or map items from an export file. It isn’t a reliable method for intentionally overwriting a current page.
The official project WordPress Importer documents importing posts, pages, custom fields, taxonomies and attachments from a WXR file. Use this tool only after testing in the staging environment, especially if the content includes complex relationships.
Handle a table or related data with care
Restoring a specific table requires extra caution. Posts, pages, media and many content types also use metadata. These associated data are often stored separately from the main content.
Consequently, replacing an entire table on the live site can erase data created after the backup or leave relationships incomplete. This approach is not suitable for a simple recovery of a post, image or file.
Instead, restore the backup in the staging environment. Identify the exact data, their relationships and the export tools of the relevant plugin. If the plugin provides no targeted export, favour a planned technical intervention rather than importing directly into the active database.
Verify the result before closing the incident
- Open the restored page, post, or media in a private window.
- Test the links, images, buttons, and forms associated with the content.
- Check that the restore didn’t remove a recent change.
- Look for duplicates in posts, pages, and media.
- Record the date of the backup used and the item restored.
A successful targeted restore isn’t just about putting an item back. It must preserve newer data, links, and normal site functionality. By working from a temporary copy, you restore what’s missing without rolling back the entire WordPress site.









