Site icon All About HTML

WordPress Backup Plugin: Restore Your Site After a Hack

Wordpress backup plugin

WordPress Backup Plugin: Restore Your Site After a Hack

A WordPress backup plugin is the one plugin you buy, or install for free, and then hope you never need. Every other plugin on your site exists to make something better: faster pages, prettier forms, higher rankings. A backup plugin exists for the day something goes wrong, and on that day it is worth more than every other plugin combined. A hack, a bad update, a host that loses a disk, a plugin that wipes your database on uninstall: any of these can take a site that took years to build and reduce it to an error page in seconds. The difference between a bad week and a lost business is whether a clean, tested copy of the site exists somewhere the attacker cannot reach, and whether you know how to put it back.

This guide covers the whole recovery chain, not just the plugin. You will learn what a WordPress backup actually has to contain, because a backup of half your site is not a backup; the 3-2-1 rule that keeps one disaster from taking your copies too; how to choose a WordPress backup plugin from the four that matter in 2026, with real prices checked this month; how to set up UpdraftPlus, the free default, in about twenty minutes; how to check file integrity, so you can tell a hacked file from a clean one before you restore anything; and then the recovery itself, step by step: the exact order of work for restoring a hacked site, when to restore a backup and when to rebuild from clean files instead, how to restore when WordPress will not even load, and how to test your backups before the day you need them. Every code example is complete and copy-paste ready, and nothing in the core setup needs a paid plugin.

The timing is not accidental. This site has spent the last month documenting real WordPress attacks: the PHP2Shell remote code execution flaw, the Comment2Shell vulnerability, and the critical PHP session flaws fixed in November 2026. Those posts explain how attackers get in. This one explains how you get your site back when they do, and how you make sure the next attack costs you an afternoon instead of your business.

Quick Takeaways

Why a Backup Plugin Is the Last Line of Defence

WordPress security work is usually framed as prevention: block the bad uploads, audit the plugins, update PHP, harden the session. All of that matters, and this series has covered each of it in turn, because prevention is cheaper than recovery by orders of magnitude. But prevention has a limit that no amount of hardening removes. New vulnerabilities appear every month, in core, in PHP itself, and in the plugins every site runs. The PHP2Shell flaw of October 2026 was a remote code execution bug in PHP, the language WordPress runs on, not in any plugin a site owner chose. The Comment2Shell flaw reached sites through the comment system, a feature most sites leave switched on. The session flaws fixed in November 2026 sat in PHP itself. A site owner can do everything right and still be exposed to a zero-day in a component they never touched, and the window between disclosure and patch is exactly when attackers scan the whole internet for unpatched sites.

That is why backups are a different kind of control from the rest of the security stack. A firewall, a file-type filter, or a plugin audit all try to stop the attacker from getting in. A backup assumes the attacker already got in, and answers the only question that matters at that point: can you get the site back, and how much will you lose? Without a backup, a hack means rebuilding from scratch, or paying a cleanup service to pick injected code out of thousands of files by hand, or losing years of content outright. With a backup, the same incident is a restore, a password rotation, and a patch, and the site is back the same day. The cost of the control is a plugin, a storage account, and twenty minutes of setup. The cost of not having it is the site.

There is a second reason backups matter, and it has nothing to do with attackers. Updates break sites. A theme update can white-screen a site, a plugin update can corrupt a database table, a host migration can lose files, and a site owner can delete the wrong thing. On a site with daily content, even a routine failure can mean losing a day of work. A backup plugin turns all of these from emergencies into rollbacks. The same three-click restore that recovers a hacked site also undoes a bad update in minutes, and the same off-site copy that survives a hack also survives a host that goes out of business or deletes your account by mistake. Backups are not a security tool. They are the undo button for everything that can happen to a website, and a site without an undo button is one mistake away from starting over.

The mistake most site owners make is assuming their host already handles this. Many hosts do take backups, and some take them daily, but host backups have three problems. First, you do not control the schedule, the retention, or the restore point, so the only copy available may be from after the hack started, which is worse than useless, because restoring it restores the malware. Second, host backups usually live on the same infrastructure as the site, so a problem at the host, a billing dispute, a compromised hosting account, or a ransomware incident at the provider can take the backups with it. Third, restoring from a host backup often means opening a support ticket and waiting, while a plugin restore runs from your own dashboard in minutes. Host backups are a useful second layer. They are not a backup strategy. Your own plugin, your own schedule, your own off-site storage: that is the strategy, and this guide sets it up.

What a WordPress Backup Actually Has to Contain

A WordPress site is not one thing. It is two things that depend on each other: a database and a set of files, and a backup that misses either half cannot restore the site. The database holds everything that changes when you work on the site: posts, pages, comments, menus, widgets, settings, user accounts, and the metadata that ties it all together. The files hold everything that was installed or uploaded: the WordPress core files, the themes, the plugins, the media library, and the two small configuration files that tell WordPress how to find the database. Lose the database and you have a site with no content. Lose the files and you have content with nowhere to display it. Both halves have to be backed up, on the same schedule, and restored together, or the restore fails in confusing ways: a site that loads but shows no posts, a site that shows posts but no images, a site that works until you log in and find every user gone.

The database is the smaller half, usually a few megabytes to a few hundred megabytes, and it changes constantly. Every new post, every comment, every settings change writes to it. Because it is small and changes fast, it is cheap to back up often: daily is the minimum for an active site, and every few hours is reasonable for a store or a news site. The standard export tool is mysqldump, which every host provides, and WP-CLI wraps it in one command:

wp db export /backups/db-20261128.sql

That command writes a plain SQL file with every table in the database. To restore it, you import the file back into an empty database:

wp db import /backups/db-20261128.sql

If you do not have SSH access, the same export is available in phpMyAdmin, under the Export tab, and the same import under the Import tab. The format is the same either way: a SQL dump that recreates every table and every row. Keep the export off the server, because a database dump sitting in a public web directory is a gift to anyone who finds it: it contains every user account and every password hash on the site.

The files half is larger and changes more slowly. It has four parts. wp-content/themes holds your active theme and any others you have installed. wp-content/plugins holds every plugin. wp-content/uploads holds the media library: every image, PDF, and attachment, usually organised into year and month folders. And the site root holds the WordPress core files, plus wp-config.php, the file with the database credentials and the security keys, and .htaccess, the file with the server rules. A complete file backup covers all four parts. Most backup plugins do, with one gap worth knowing about: the free version of UpdraftPlus backs up the database, plugins, themes, and uploads, but it does not back up wp-config.php or any file outside wp-content. That is a deliberate limit of the free version, not a bug, and the fix is simple: copy wp-config.php and .htaccess to your off-site storage yourself, once, and again whenever you change them. They are small text files. Losing them means reconstructing your database credentials and your security keys by hand during a recovery, which is exactly the job you do not want to be doing at two in the morning with a hacked site.

There is one more file worth backing up, and it is the one most site owners forget: the list of what is installed and which version. After a hack, you will delete every plugin and theme and reinstall fresh copies, and you need to know what the site had. A backup plugin records this automatically, because its backup manifest lists every component. If you back up manually, keep a simple list: the output of wp plugin list and wp theme list from WP-CLI, saved next to the backup. It takes ten seconds, and it turns a rebuild from a guessing game into a checklist.

The 3-2-1 Rule for WordPress Backups

The 3-2-1 rule is the oldest rule in backup practice, and it survives because it is the simplest statement of the one idea that matters: a backup that dies in the same incident as the original is not a backup. The rule says: keep three copies of your data, on two different kinds of storage, with one copy off site. For a WordPress site, that translates into a concrete setup you can build in an afternoon.

Three copies means the live site, plus two backups. The live site counts as copy one. The backup plugin keeps copy two, on a schedule, in your cloud storage. Copy three is a second backup destination, or a second schedule: a weekly full backup to a different provider, or a monthly archive downloaded to a local drive. The point of the third copy is not paranoia. It is that backups fail, silently, more often than anyone admits. A scheduled backup can fail for months without anyone noticing, because nobody looks at the backup log until they need a backup. Two independent copies mean one silent failure does not leave you with nothing. Check the backup log monthly. If the plugin has an email report, switch it on, and read it.

Two different kinds of storage means the two copies should not share a failure mode. Two folders on the same server are one kind of storage, not two: a disk failure, a server compromise, or a hosting account suspension takes both. A copy on the server and a copy in Google Drive are two kinds. A copy in Google Drive and a copy in Amazon S3 are two kinds. The practical version for most WordPress sites is: the plugin sends backups to your cloud storage automatically, and you keep a periodic copy somewhere else entirely, a second cloud account, an external drive, or a different host. The two kinds do not have to be exotic. They just have to be independent.

One copy off site is the part that saves you from the worst cases. Off site means not on the server that runs the site, and not on any machine that shares its fate. A backup stored in wp-content/backups on the same server is not off site: an attacker who owns the site can delete it, a ransomware incident can encrypt it, and a host failure can take it. A backup in Google Drive, Dropbox, or Amazon S3 is off site. So is a copy on your own laptop, as long as it is a copy and not the only copy. Every backup plugin in this guide sends backups to cloud storage by default, and that is the feature that matters most. A plugin that backs up only to the same server is a plugin that has not understood the job.

One more rule sits on top of 3-2-1, and it is the one this guide will repeat: a backup you have never restored is a hope, not a plan. Backups fail in ways that only a restore reveals: a corrupt archive, a database dump that stops halfway, a plugin that backs up the files but silently skips a table, a storage account that ran out of space three months ago. The restore test is the only check that covers all of it, and it is the subject of its own section near the end of this guide. Schedule it like any other maintenance: once a quarter, restore the latest backup to a staging site, and confirm the site loads, the posts are there, and you can log in. If it works, you have a plan. If it does not, you have found the problem on a quiet afternoon instead of during a crisis.

How to Choose a WordPress Backup Plugin

Four plugins cover nearly every WordPress site in 2026. They differ in one decision that matters more than any feature list: where the backup runs, and whether the site can be restored when WordPress itself is dead. A plugin that restores from inside the WordPress dashboard is useless if the dashboard will not load, which is exactly the state a hacked site is often in. Keep that question in mind while you read the comparison, because it is the difference between a plugin that helps in a crisis and one that only helps after a bad update.

PluginFree versionPaid price (checked Nov 2026)StorageRestore when WordPress is downBest for
UpdraftPlusYesPremium from 70 dollars per year for 2 sitesYour cloud accounts: Google Drive, Dropbox, Amazon S3, FTP, emailNo, needs WordPress working, or a manual restoreMost blogs and small sites
BlogVaultNo, first backup freePersonal 49.50 dollars per year for the first year, renews at 99 dollarsBlogVault servers, nine encrypted copiesYes, from its own dashboardBusiness sites that cannot afford downtime
Jetpack VaultPress BackupNo4.95 dollars a month for the first year, renews at 9.95 dollars a month billed yearlyJetpack cloud, 10 GB to startYes, from the Jetpack dashboardWooCommerce stores, real-time backups
WPvividYes49 dollars per year, or 99 dollars lifetimeYour cloud accountsNo, needs WordPress working, or a manual restoreBest value if you want premium features cheaply
DuplicatorYesPro from 49.50 dollars per yearYour storage or local downloadManual, by design, it is a migration tool firstMoving a site to a new host

UpdraftPlus is the safe default, and it is the one this guide sets up step by step. It runs on more than 4 million sites, which matters for a backup tool, because a backup tool with millions of restores behind it has had its failure modes found and fixed. The free version covers the core job: manual and scheduled backups of the database, plugins, themes, and uploads, sent to Dropbox, Google Drive, Amazon S3, Rackspace Cloud, FTP, DreamObjects, OpenStack Swift, or email, on a schedule from every two hours to monthly. Restores take three clicks from the dashboard, and you can restore single parts instead of the whole site, which is useful when only the database or only the uploads are damaged. Premium, from 70 dollars a year for two sites, adds incremental backups, automatic backups before updates, more storage options including OneDrive, Azure, Google Cloud, Backblaze B2, SFTP, and pCloud, and the ability to restore backups made by other plugins. Its limits are honest ones: the free version does not back up wp-config.php or files outside wp-content, so you copy those yourself, and a restore needs WordPress to be working, so a fully dead site needs the manual restore covered later in this guide.

BlogVault is the pick for a site that earns money. It has no free version, but the first backup is free with no card required, so you can test it before paying. The Personal plan costs 49.50 dollars per site per year for the first year and renews at 99 dollars. What you pay for is that the backups and the restores run on BlogVault servers, not on your site: backups do not slow the site down, several encrypted off-site copies are kept, and the restore works even when WordPress will not load, from the BlogVault dashboard. It keeps 30 days of backups, includes staging and migration, and lets you test a restore before doing it for real. For a business site, that last feature alone is worth the price: a restore you have tested is a restore you can trust.

Jetpack VaultPress Backup is the real-time pick, and it is the only one on this list built for a store. It costs 4.95 dollars a month for the first year and renews at 9.95 dollars a month, billed yearly, with 10 GB of Jetpack cloud storage to start and a 30-day activity log. Real-time means every change is saved as it happens: each new order, comment, or edit is backed up the moment it occurs, instead of at the next nightly backup. For a WooCommerce store, that is the difference between losing the orders placed since last night and losing nothing at all. Restores are one click from the Jetpack dashboard, and you pick the exact moment to go back to from the activity log. It needs a WordPress.com connection, and the storage limit on the base plan is something to watch on a large store, but for a shop doing orders all day, it is the right tool.

WPvivid is the value pick. The free version covers scheduled backups and restores to your own cloud storage, and the paid version, 49 dollars a year or 99 dollars for a lifetime licence, adds incremental backups, staging, and migration at a price well below the others. Duplicator is different in kind: it is a migration tool that also backs up, and it is the right choice when the job is moving a site to a new host rather than recovering one. Pick by the failure you fear most. A blog fears a bad update and a hack, and UpdraftPlus free covers both. A business fears downtime, and BlogVault covers that. A store fears losing orders, and VaultPress covers that. A site on a tight budget that still wants premium features picks WPvivid. What you should not do is pick by feature count alone. The feature that matters is the restore, and the restore you should test before you trust it.

Set Up UpdraftPlus in Twenty Minutes

This is the whole setup, start to finish, for the free version. It takes about twenty minutes, most of it waiting for the first backup to upload. Do it now, not after the next security story in this series, because the backup only protects you from the moment it first runs.

First, install the plugin. In the WordPress dashboard, go to Plugins, then Add New, search for UpdraftPlus, and install and activate “UpdraftPlus: WP Backup and Migration Plugin”. There is only one official plugin with that name, published by Team Updraft, with more than 4 million active installs. Check the author and the install count before you click, because backup plugins are a popular target for lookalike plugins with similar names.

Second, connect storage. Go to Settings, then UpdraftPlus Backups, then the Settings tab. Choose your remote storage. Google Drive is the common pick, because most site owners already have an account, but Dropbox and Amazon S3 work the same way. Click the storage name, follow the authorisation link, and grant UpdraftPlus access to a folder in your account. Pick one destination per backup in the free version, and make it a destination you control, not a folder on the same server. While you are here, note the warning from the last section: the free version does not back up wp-config.php or files outside wp-content. Download those two files now, wp-config.php and .htaccess from the site root, and save them in the same cloud folder as your backups. Repeat whenever you change them.

Third, set the schedule. In the same Settings tab, set the file backup schedule and the database backup schedule separately, because the two halves change at different speeds. A reasonable starting point for a blog that publishes weekly: files weekly, database daily. A site that publishes daily: files weekly, database daily, and a manual backup before any update. A store: files daily, database every few hours, or switch to a real-time tool. Then set retention, the number of backups to keep: two to four full backups is a sensible range. Retention is the setting people forget, and it matters, because a backup that is six months old is the only restore point you have if the newer backups are all infected. Keep more than one, and keep at least one from before any incident you might discover late. A hack discovered three weeks after it happened needs a backup from four weeks ago, and if retention only kept the last two, that backup is gone.

Fourth, run the first backup now. Go to the Backup and Restore tab and click Backup Now. Choose to include the database and the files, and to send the backup to remote storage. The first backup is the slow one, because it copies every file in the site. Wait for it to finish, then check the cloud folder and confirm the files are actually there: you should see a set of zip files, one per component, database, plugins, themes, uploads, and others, with the current date in their names. Then check the backup log for errors. UpdraftPlus reports a failed upload clearly, but only if you look. Switch on the email report in the Settings tab, so a future failure finds you instead of waiting for you to notice.

Fifth, test the restore, on a staging site, before you need it. The full test procedure has its own section below, but do the minimum version now: create a staging copy of the site, or a local install, restore the backup there, and confirm the site loads and you can log in. If the test works, you have a backup. If it does not, you have found the problem on a quiet afternoon, which is the entire point.

Sixth, write down the recovery facts and keep them off the server. A backup is only useful if you can reach it when the site is down, and the site being down is exactly when you cannot open the dashboard to look up the storage login. Keep a short note, on paper or in a password manager, with the storage account, the backup schedule, the retention count, and the date of the last tested restore. Add the hosting login and the database credentials, or at least where to find them. This note is the difference between a recovery that starts in five minutes and one that starts after an hour of searching for passwords.

File Integrity: How to Know a File Changed

A backup tells you what the site looked like on the day it was taken. File integrity tells you what has changed since. Together they answer the question every hacked-site recovery starts with: which files can I trust, and which ones did the attacker touch? Without an integrity check, you are guessing. You might restore a backup that already contains the backdoor, or delete a file that was never infected, or spend hours cleaning files that were fine while the real backdoor sits in a plugin you never looked at. The check is quick, and it should be part of routine maintenance, not just incident response. Run it monthly, and run it the moment anything about the site looks wrong.

The idea is simple. WordPress.org publishes a checksum, a fingerprint, for every file in every released version of WordPress, and for every plugin and theme in the official directory. A checksum is a short string computed from the exact contents of a file: change one character and the checksum changes completely. So if you compute the checksum of a file on your server and compare it against the published checksum for the same file, a match means the file is untouched, and a mismatch means someone changed it. You do not need to read the file or understand the code. The comparison does the work.

WP-CLI, the command-line tool for WordPress, has this check built in. If your host gives you SSH access, these three commands cover the whole site:

wp core verify-checksums

That checks every WordPress core file against the official release for your installed version. A clean run prints a success message. A dirty run lists the files that differ, the files that are missing, and, with the root files included, the files that should not exist at all. To include the site root, where index.php, wp-login.php, and any planted file would sit, add the flag and pin the version:

wp core verify-checksums --include-root --version=$(wp core version)

Then the plugins, and the themes:

wp plugin verify-checksums --all
wp theme verify-checksums --all

Add --strict to the plugin check if you want small changes flagged too, such as a modified readme file:

wp plugin verify-checksums --all --strict

There are two limits to know. First, checksums only exist for plugins and themes hosted on WordPress.org. A premium plugin bought from a developer site, or a custom theme built for your site, has no published checksum, and the tool reports it as unverifiable rather than clean. That is not a failure: it means you need another check for those files, such as comparing them against the copy the developer sent you, or watching their modification dates. Second, the check avoids loading WordPress while it verifies, so tampered code is not executed during the check itself. That is a deliberate safety property, and it is why the WP-CLI check is safer than a plugin-based check on a site you already suspect.

One current gotcha is worth recording. On WordPress 7.x sites downloaded with WP-CLI 2.12 or older, verify-checksums can report files under wp-includes/php-ai-client/ as missing, and cut-off file names as files that should not exist. That is a WP-CLI extraction bug, not a modified core, and the fix is to re-download core with a current WP-CLI build. If you see that specific pattern, check your WP-CLI version before you panic.

If you do not have SSH access, Wordfence does the same comparison from inside WordPress. Install Wordfence Security, run a full scan, and it compares core files, themes, and plugins against the official repository versions, flags any modification, and checks for known malware signatures, backdoors, and shells. One honest limit: the free version of Wordfence receives new malware signatures 30 days after Premium users get them, so a brand-new piece of malware may not be in the free signature set yet. The checksum comparison does not have that lag, because it does not depend on signatures at all: a changed file is a changed file, whatever changed it. Use both if you can. A remote scanner such as Sucuri SiteCheck is a useful third view: it checks what visitors see, blacklist status, and visible malicious code, but it cannot see server files or the database, so a clean remote result never proves a site is clean.

Two more checks belong in the same routine, and they need no plugin at all. First, list the administrator accounts and confirm you recognise every one:

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered

A new admin user you did not create is one of the clearest signs of a compromise, and it is also one of the first things an attacker does after getting in. Second, look for PHP files where code should never live. The uploads folder should hold images, not code, and a PHP file inside it is either a mistake or a shell:

find wp-content/uploads -type f -name '*.php'

An empty result is the right answer. Any file listed needs investigating before anything else. A related check finds PHP files modified recently, compared against a file you know is clean and dated before the compromise:

find /path/to/wordpress -type f -name '*.php' -newer /path/to/reference-file -ls

Replace the paths with your own. This surfaces exactly the files an attacker touched, and the common hiding places are predictable: code added to the top or bottom of wp-includes/functions.php, your theme functions.php, redirect rules in .htaccess, and fake plugin directories inside wp-content/plugins that do not match any plugin you installed. Run these checks monthly, and keep a note of the results. A checksum report from last month is the baseline that makes this month report meaningful, because a file that changed between two clean reports is a file worth opening.

Restore Your Site After a Hack: The Full Sequence

The instinct after discovering a hack is to restore a backup immediately and forget it happened. Resist that instinct until you understand how the site was compromised. If you restore a backup without closing the entry point, you rebuild the same vulnerable target, and the attacker returns through the same door, often within days, sometimes within hours. The order of work below is the order that matters: contain, preserve evidence, close the hole, clean, restore, verify, and only then harden. Skipping a step does not save time. It repeats the incident.

Step 1: take a snapshot of the infected site, before you change anything. This sounds backwards, and it is the step most people skip, but it is the one that saves you when a cleanup step breaks the site. A full copy of the infected files and a full export of the infected database give you a way back to “hacked but working” if a cleaning step goes wrong, and they preserve the evidence of what the attacker changed. Label the copy clearly, for example INFECTED, do not restore, and store it off the server:

tar -czf /tmp/infected-backup-20261128.tar.gz /path/to/wordpress/
mysqldump -u USERNAME -p DATABASE_NAME > /tmp/infected-db-20261128.sql

Replace the paths and credentials with your own. Keep this copy until the recovery is finished and verified, then delete it. An infected backup is evidence, not a restore point, and it must never be confused with a clean one.

Step 2: contain the damage. Put the site into maintenance mode, or take it offline if the host allows it, so visitors stop hitting infected pages and the attacker stops using the site while you work. If the host has suspended the site or Google has flagged it, that decision is already made for you. Tell the host what happened: a host that knows about a compromise can check neighbouring accounts on shared hosting, and a host that does not know may restore the site from its own backups and undo your work. Change the hosting control panel password from a computer you trust, before you touch WordPress itself.

Step 3: find how the attacker got in. Run the integrity checks from the previous section, wp core verify-checksums and wp plugin verify-checksums --all, and run a Wordfence scan. Look at recently modified files and at the uploads folder for PHP. Check the administrator list for accounts you did not create. Look at the access logs around the time the problems started, if the host provides them, for the requests that do not belong: a POST to a plugin file that should never receive one, a request for a file that did not exist the day before, a login from an unfamiliar address. Compare the infected site against your last clean backup if you have one: the files that differ are the files the attacker touched. The usual entry points, in order of frequency, are a vulnerable plugin, a vulnerable theme, a weak admin password, a compromised hosting account, and an upload that became a shell. You need to know which one it was, because the fix for each is different.

Step 4: close the hole before you restore anything. Update or remove the vulnerable plugin. Replace the weak password with a strong one and switch on two-factor authentication. Block PHP execution in the uploads folder, as covered in the file-upload security guide in this series. Patch PHP and WordPress core to the current release. If the entry point was a plugin you do not need, delete it instead of updating it: every plugin you do not run is a plugin that cannot be exploited. This step is the whole difference between a recovery and a repeat.

Step 5: replace the core files with fresh copies. Do not try to edit infected core files line by line. Attackers hide code in many places at once, and a file you clean by hand usually has a second injection you did not see. Download a fresh copy of the same WordPress version from WordPress.org, delete everything in the site root except wp-content and wp-config.php, and upload the clean core files. With WP-CLI, one command does the same job:

wp core download --force --skip-content

That replaces wp-admin, wp-includes, and the root files such as index.php and wp-login.php, and leaves wp-content alone. Inspect wp-config.php line by line against the clean wp-config-sample.php from the fresh download: it should contain only database credentials, salts, the table prefix, debug settings, and the ABSPATH block. Anything else is injected code. Inspect .htaccess the same way, and compare any .user.ini or php.ini files against clean versions.

Step 6: delete every plugin and theme, then reinstall from clean sources. This is the step people resist, because it feels destructive, but it is the only reliable way to be sure the plugin and theme folders are clean. A plugin folder can contain a backdoor file alongside the real plugin files, and the checksum check only covers plugins from WordPress.org. Delete the folders, then install fresh copies from WordPress.org or from the original developer. If you made custom changes to a theme, compare your copy against the original line by line with a diff tool and remove only the injected code, which usually appears as obfuscated PHP: long strings of base64-encoded content that do not look like legitimate theme code. Restore your custom work from your own version control or your own backup, never from the infected copy.

Step 7: clean the database and the user accounts. Malware hides in the database too: injected links and spam posts in wp_posts, malicious option values in wp_options, and rogue widget content. Search the database for the strings the scan flagged, and for the domains the attacker used. Delete every user account you do not recognise, and check the remaining admins one by one. If the site had a form plugin or a membership plugin with its own user tables, check those too. A backdoor left in the database lets the attacker return after the files are clean, so this step is not optional.

Step 8: change every password and regenerate the salts, now that the site is clean, and not before. Changing credentials while a backdoor is still live just hands the attacker the new ones, which is why this step sits here and not at the start. Change the WordPress admin passwords, the database password, the hosting password, the FTP and SSH passwords, and any API keys the site used. Then replace the eight security keys and salts in wp-config.php with fresh ones from the official WordPress salt generator at api.wordpress.org/secret-key/1.1/salt/. Fresh salts log out every session on the site, including any session the attacker is holding.

Step 9: restore from a clean backup, or rebuild, and know which one you are doing. If you have a backup from before the hack started, restoring it is almost always faster and more thorough than manual cleanup. Restore it now, on top of the clean core and clean plugins, and then re-run the integrity checks and the Wordfence scan. If you do not have a backup from before the infection, or you do not know when the infection started, finish the manual cleanup instead, and treat the cleaned site as the new baseline. The hard question is whether a backup is clean. A backup is clean if it predates the first sign of the compromise, and if the integrity check on the restored files comes back clean. If the backup is from after the hack began, restoring it restores the malware, and you have wasted the recovery. When in doubt, restore the oldest backup you trust, and verify it with the checksums before you call the site clean.

Step 10: rescan until nothing remains. Run the Wordfence scan again, and the WP-CLI checksum commands again, and the uploads-folder check again. A single clean scan is not proof: run two different scanners, because each one misses things the other catches, and confirm the results agree. Check the site in a browser as a visitor, and check Google Search Console for a security warning or a blacklist flag. If the site was blacklisted, request a review in Search Console only after the scans are clean, because a review requested while malware is still present wastes the request and delays the next one.

Step 11: harden, using the rest of this series. Block PHP execution in uploads, audit the plugins against the vulnerability checklist, update the PHP version, harden the session handling, and check the XSS protections. Each of those guides exists because each of those layers stops a different attack. A recovered site that is not hardened is a site waiting for the next incident.

Step 12: write down what happened. The date the hack was found, the entry point, the files that were changed, the backup that was restored, and the fixes that were applied. Keep it with the backup records. The next time something looks wrong, that note is the first thing you will reach for, and it is also the record that proves to a client, an insurer, or a host that the recovery was done properly.

Restore With UpdraftPlus

When WordPress is still working, an UpdraftPlus restore is three clicks. Open Settings, then UpdraftPlus Backups, and look at the Existing Backups list. Pick the backup from before the hack started, and choose which parts to restore: database, plugins, themes, uploads, and others. You can restore the whole site, or a single part, which is useful when only the database or only the uploads are damaged. Click Restore, confirm, and wait. UpdraftPlus restores the files, imports the database, and reports the result. When it finishes, log out and log back in, check the site as a visitor, and run the integrity checks again. The restore is not finished until the checks come back clean.

Two cautions. First, the backup you restore must predate the hack, and the date on the backup is the date it was taken, not the date the hack started. If the hack began three weeks ago and your oldest backup is two weeks old, that backup is infected, and restoring it restores the malware. Retention matters here: keeping four or five backups instead of two is what gives you a clean restore point when the discovery is late. Second, an UpdraftPlus restore replaces the database and the files it covers, but it does not replace wp-config.php, because the free version never backed it up. If wp-config.php was modified, inspect it by hand against the clean sample, as in Step 5 above, and restore your saved copy of it from off-site storage.

Restore When WordPress Will Not Load

A hacked site often will not load at all: a white screen, a redirect loop, or an error from a corrupted file. UpdraftPlus cannot help from inside a dashboard that will not open, and neither can any plugin. The manual restore is the answer, and it is less frightening than it looks, because it is the same four moves every time: fresh core, clean files, the database, and the configuration.

First, download the backup from your cloud storage to your own computer, and unzip it. An UpdraftPlus backup is a set of zip files, one per component, with the database as a SQL file, usually compressed. Keep the set together and labelled with the backup date.

Second, set up a clean WordPress install. Either wipe the site directory on the server and install a fresh WordPress of the same version, or install fresh on a new directory or a staging domain and move it later. Do not reuse any file from the infected site except wp-content/uploads, and only after you have checked that folder for PHP files with the find command from the integrity section. Themes and plugins come fresh from WordPress.org or the original developer, never from the infected copy.

Third, restore the database. Create an empty database on the host, or empty the existing one, and import the SQL file from the backup, either in phpMyAdmin under the Import tab, or with WP-CLI:

wp db import /backups/db-20261128.sql

If the restore is going to a different domain, for example a staging domain or a new host, the database still contains the old domain in dozens of places, and the site will redirect to the old address or load its assets from the wrong place. WP-CLI fixes that in one command, run after the import:

wp search-replace 'old-domain.com' 'new-domain.com'

Use the plain domain, without a scheme, and let the command handle the serialised data. A manual find-and-replace in the SQL file breaks serialised arrays and corrupts settings, so do not do it by hand.

Fourth, restore the configuration. Copy your saved wp-config.php into the site root, or create a fresh one with the new database credentials and fresh salts from the WordPress salt generator. Copy your saved .htaccess if you have one, or let WordPress regenerate it by saving the permalink settings. Then log in, check the site as a visitor, and run the integrity checks. A manual restore that passes the checksum checks and the Wordfence scan is a clean site, and it is the same site you had before the hack, minus whatever the attacker added.

Test Your Backups Before You Need Them

A backup you have never restored is a hope, not a plan, and the test is simple enough to run once a quarter. BlogVault builds a test restore into the product. For every other plugin, the test is a manual procedure, and it takes about half an hour.

Create a staging site, either a subdomain on your host, a local install, or a free staging tool, and restore the latest backup there. With UpdraftPlus, install WordPress on the staging site, install UpdraftPlus, upload the backup files to the staging site, and run the restore from the dashboard. With a manual backup, copy the files and import the database as in the previous section, and run the search-replace for the staging domain. Then check three things: the site loads as a visitor, every post and image is present, and you can log in to the dashboard. If all three pass, the backup is good, and you have proven the restore procedure works. If any of them fails, you have found the problem on a quiet afternoon, and you can fix the backup settings, the storage, or the retention before the next incident.

Two details make the test honest. First, test the backup you would actually restore, which is the latest one, not a hand-picked old one that you know is good. Second, test on a schedule, not when you remember. Put it in the calendar, once a quarter, next to the plugin update check and the integrity check. The three checks together, backups, integrity, and updates, are the maintenance routine that keeps a WordPress site recoverable, and they take less than an hour a quarter.

Backup Schedule by Site Type

How often you back up should follow how often the site changes, and how much you can afford to lose. A backup schedule is a statement about acceptable loss: a daily database backup means you accept losing at most a day of content. A weekly file backup means you accept losing at most a week of uploads. Pick the numbers deliberately, and write them down with the rest of the recovery facts.

Site typeDatabaseFilesRetentionNotes
Personal blog, weekly postsDailyWeekly4 full backupsManual backup before every update
Business site, daily editsDailyWeekly4 full backupsTest restore every quarter
News or magazine, many posts a dayEvery 6 hoursDaily7 full backupsConsider incremental backups in Premium
WooCommerce storeReal-time, or every hourDaily30 days of backupsJetpack VaultPress Backup or BlogVault WooCommerce plan, because orders between backups are lost orders
Portfolio or brochure site, rarely changedWeeklyMonthly3 full backupsStill back up: a static-looking site still has a database, users, and settings worth losing

The pattern is consistent: the database changes faster than the files, so it is backed up more often, and a store cannot tolerate a nightly backup because an order placed at 3 in the afternoon and lost at midnight is a customer lost for good. If the site takes payments, real-time backup is not a luxury. It is the cost of taking payments.

7 Mistakes That Make Backups Useless

Most backup failures are not technical. They are decisions that seemed reasonable at the time and only reveal themselves during a recovery. Each of these has been the reason a real site could not be restored.

MistakeWhat happensFix
Backups stored on the same serverThe hack, the disk failure, or the suspended account takes the backups with the siteSend every backup to off-site cloud storage, and keep a second copy elsewhere
Only the files, or only the databaseA file-only restore has no content, a database-only restore has nowhere to display itBack up both halves, on the same schedule, and restore them together
Retention of one backupThe only copy is from after the hack started, so restoring it restores the malwareKeep four to five backups, so a late discovery still leaves a clean restore point
Never testing a restoreA corrupt archive, a half-finished database dump, or a full storage account is discovered during the crisisRestore to staging once a quarter and confirm the site loads and you can log in
Restoring before closing the holeThe attacker returns through the same entry point within daysFind the entry point and patch it before any restore, and verify with a scan after
Backing up an infected site as the clean copyThe “clean” backup contains the backdoor, and every restore from it re-infects the siteRun the integrity checks before you label a backup clean, and keep pre-incident backups separate
No record of where the backups areThe site is down, the dashboard is unreachable, and nobody can find the storage loginKeep the storage account, schedule, retention, and last tested restore date in a note off the server

Frequently Asked Questions

1. What is the best WordPress backup plugin for a small blog?

UpdraftPlus free is the best starting point for most blogs: more than 4 million active installs, scheduled backups to Google Drive, Dropbox, or Amazon S3, and three-click restores, all free. Its limits are that it does not back up wp-config.php in the free version and it cannot restore a site when WordPress will not load, so copy wp-config.php yourself and know the manual restore in this guide. If the blog earns money, BlogVault at 49.50 dollars per site per year for the first year is the upgrade, because the restore works even when WordPress is down.

2. How often should I back up my WordPress site?

Back up the database daily and the files weekly on a normal blog or business site, and back up both more often on a site that changes faster. A WooCommerce store needs real-time backup, because every order placed between backups is an order that cannot be recovered. Whatever schedule you pick, run a manual backup before every WordPress, theme, or plugin update, and keep four to five backups so a late discovery of a hack still leaves a clean restore point.

3. Does my host backup count as a WordPress backup?

It counts as a second layer, not a strategy. You do not control the host backup schedule, retention, or restore point, so the only copy available may be from after a hack started. Host backups also usually live on the same infrastructure as the site, so a problem at the host can take them too, and restoring one often means waiting on a support ticket. Keep your own plugin backup, on your own schedule, in your own off-site storage, and treat the host backup as a spare.

4. Can I restore a hacked WordPress site from a backup?

Yes, but only if the backup predates the hack, and only after you close the entry point the attacker used. Restore the backup, then re-run the integrity checks and a Wordfence scan to confirm the restored files are clean. If you restore before patching the vulnerability, the attacker returns through the same door. If the backup is from after the hack began, restoring it restores the malware, so restore the oldest backup you trust and verify it with the checksum commands before you call the site clean.

5. What does file integrity mean for WordPress?

File integrity means every file on the server matches the official copy published by WordPress.org or the plugin and theme directory. A file that differs has been changed, by an update, by you, or by an attacker. The check is wp core verify-checksums for core files and wp plugin verify-checksums --all for plugins, or a Wordfence scan from inside the dashboard. Checksums only exist for plugins and themes hosted on WordPress.org, so premium and custom code needs a different check, such as comparing against the copy the developer sent you.

6. What is the 3-2-1 backup rule?

Keep three copies of your data, on two different kinds of storage, with one copy off site. For WordPress, that means the live site, a plugin backup in your cloud storage, and a second copy somewhere independent, such as another cloud account or a local drive. The rule exists because a backup that dies in the same incident as the original is not a backup, and because scheduled backups fail silently more often than anyone admits.

7. How do I restore WordPress when the dashboard will not load?

Restore manually: download the backup from your cloud storage, install a fresh WordPress of the same version, upload the clean wp-content files after checking the uploads folder for PHP, import the database with wp db import or phpMyAdmin, run wp search-replace if the domain changed, and restore your saved wp-config.php. If you use BlogVault or Jetpack VaultPress Backup, restore from their dashboards instead, because both can restore a site when WordPress itself is down.

Conclusion

A WordPress backup plugin is the cheapest insurance a site owner can buy, and the only control that works after an attack has already succeeded. Hardening keeps most attackers out. A backup is what gets the site back when one gets in, and the difference between the two is the difference between a bad afternoon and a lost business. The setup is twenty minutes with UpdraftPlus free, and the maintenance is an hour a quarter: a daily database backup, a weekly file backup, both sent off site, four or five copies kept, and a test restore on staging to prove the whole thing works. File integrity checks, run monthly and after any incident, tell you which files to trust and which ones the attacker touched, so the restore puts back a clean site instead of a fresh copy of the malware.

Do the setup today, before the next security story in this series, because a backup only protects you from the moment it first runs. Then test the restore, write down where the backups live and when they were last tested, and keep that note somewhere you can reach it when the site is down. The day you need it, you will be glad the work was already done. If this guide helped you set up backups, read the rest of the WordPress security series next: the plugin vulnerability audit, the XSS prevention checklist, and the file-upload security guide, because a backup and a hardened site together are what turn a hack from a disaster into a footnote.

Related Articles You’ll Love

Exit mobile version