If you are deciding whether to restore WordPress backup after malware infection, the safest answer is: only after checking whether that backup is likely to predate the compromise. The newest copy may include the malware, an unauthorized account, or changes that helped the attacker regain access. Restoring without review can bring the problem back.
A backup can be an important part of recovery, but it is not proof that a site is clean. Treat the restore as a candidate for testing, not as a finished fix. Preserve the affected site, investigate the likely compromise window, restore in a controlled environment, and verify both the files and the database before reopening the site.
Why the newest backup may not be clean
Malware may be present before you notice visible symptoms. A warning, redirect, unfamiliar administrator, or sudden change in site behavior can be a clue, but the intrusion may have started earlier. If a backup was made after access was gained, it could contain altered files, a hidden account, or malicious database content.
Start by estimating the earliest plausible compromise date, rather than relying only on when the problem first appeared. Review available security alerts, hosting logs, file-change records, unfamiliar user accounts, and reports from people who noticed unexpected behavior. Look for more than one indicator, and record what you find. If the evidence does not establish a trustworthy starting point, do not assume that an older-looking backup is safe.
WordPress describes backups as a way to restore a site, and its guidance covers keeping copies of both files and the database. A usable backup should be assessed as a complete recovery point, not just a collection of site files. See the WordPress backup guidance for its recommendations.

Preserve the affected site and select a candidate backup
Before changing the production site, preserve a copy of its current files and database where possible. This can help with investigation and may be useful if the first recovery attempt fails. Avoid deleting suspicious material before it has been documented, especially when you do not yet know how the intrusion happened.
Next, compare available backup dates with the indicators you gathered. A candidate is more promising when it predates the earliest plausible compromise, but date alone cannot establish that it is clean. Consider whether there were signs of unauthorized access before the backup, whether the copy includes both files and database, and whether it can be inspected in an isolated environment.
If you are unsure how to interpret logs or changes, involve your hosting provider or a qualified WordPress security professional before replacing the live site. This is especially important when the incident's scope is unclear or the site handles sensitive information. For more context on recovery planning, see WordPress disaster recovery considerations.
Test the restore in a controlled environment
Restore the candidate backup to a staging site or another environment that is isolated or access-restricted. Do not let a test copy send customer emails, process live orders, or connect to services in ways that could affect real users. Keep it out of public view while you inspect it, and make sure it cannot be mistaken for the production site.
Restore both the WordPress files and the matching database. The database may contain user accounts, settings, content, and other site information, so checking files alone is not enough. If the restore process is unfamiliar, ask your host or a professional to help keep the test environment separate from production.
Once restored, review the site for signs of compromise. Check for administrator accounts you do not recognize, unexpected plugins or themes, modified files, suspicious code, and redirects or content that you did not add. Review database users and site settings as well as the visible pages. WordPress lists common security practices in its hardening guidance; use it as a reference while addressing the underlying weaknesses.
For a closer look at indicators that a site may still be affected, use this WordPress hacked-site cleanliness checklist. A site that loads normally is not necessarily clean. Make checks from more than one perspective, including the public-facing experience and the administrative area.
Check the cause before putting the site back online
A clean-looking restore is not a complete recovery if the path used to compromise the site remains open. Review how access may have been gained. Consider outdated software, unsafe or unfamiliar extensions, compromised credentials, and accounts that should no longer have access. Remove or update what is appropriate, and verify that administrative access is limited to people who need it.
Change WordPress, hosting, database, and related service passwords after restoring, using a trusted device and a secure process. If credentials may have been exposed, changing only the WordPress administrator password may leave other access paths available. Review connected accounts and access keys as well, and invalidate anything that is no longer trusted.
Before reopening the site, check that important pages work, forms behave as expected, and there are no unexpected redirects or unfamiliar content. Confirm that security and monitoring tools are active, and keep watch for renewed alerts, suspicious file changes, or unusual account activity after launch. For an e-commerce site, verify key shopping and payment flows in the controlled environment before directing customers back to it.
When to pause and get help
Self-service recovery may be reasonable when the compromise is understood, a credible pre-compromise backup is available, and you can inspect and secure the restored site. Pause and seek qualified help if you cannot determine when access began, you do not know what was changed, or the infection returns after a restore.
Businesses handling sensitive information should be especially careful about declaring an incident resolved based only on a successful restore. Ask your hosting provider or an incident-response professional to help assess the scope and validate recovery. If malware returns, take the site back out of public service as appropriate, preserve the new evidence, and investigate the access path rather than repeatedly restoring the same copy.
Frequently asked questions
Is it safe to restore the newest WordPress backup after malware?
Not automatically. First assess whether it predates the earliest plausible compromise, then test it in an isolated environment and inspect files and the database before using it in production.
Can a backup restore bring malware or a backdoor back?
Yes. If the backup was created after the compromise, it may contain malicious changes or unauthorized access. That is why backup timing and post-restore checks both matter.
Should I change passwords after restoring?
Yes, if credentials may have been exposed. Change WordPress, hosting, database, and related service credentials, and review other access that could allow changes to the site.
What if malware returns after the restore?
Do not keep restoring the same backup without further investigation. Preserve the evidence, restrict access to the affected site, and ask your host or a qualified security professional to help identify the remaining cause.
Conclusion
The newest backup is useful only if it is a trustworthy recovery point. Assess when the compromise may have begun, test a candidate restore away from production, review both files and the database, and address the access path before reopening the site. If the timeline or scope is unclear, contact your hosting provider or a WordPress security professional for help validating the recovery.