WordPress infected with malware: first steps to recover a business website

Published on 2026-11-14 by frfrand

What to do when a WordPress website has been compromised: containment, evidence, cleaning, restoration, and prevention.

WordPress infected with malware: first steps to recover a business website

# WordPress infected with malware: first steps to recover a business website

A compromised WordPress website is not fixed simply by installing an antivirus plugin. If an attacker retains an administrative account, a backdoor, or hosting access, they can reinfect it hours later. The initial goal is not to make the homepage look pretty: it is to stop the damage, preserve evidence, and recover a reliable service.

1. Contain without destroying evidence

If there are redirects to fraudulent sites, spam, unknown users, or suspicious PHP files, declare an incident. Temporarily restrict administrative access, disable exposed functions if necessary, and notify whoever manages the server. If there is an online store, prevent customers from entering sensitive data while the scope is determined. Changing files before saving a copy can erase the entry trail.

Do not immediately delete the entire directory or run unknown cleanup scripts. Note the first observed time, affected URLs, recent changes, and available accesses.

2. Preserve copies and logs

Before cleaning, create a complete copy of files, database, and HTTP, PHP, system, and authentication logs. Store it outside the affected server with restricted access and an identifiable date. Also keep a copy prior to the incident if one exists. An infected copy can be useful as evidence, but you should not automatically restore it to production.

Check which components have been touched: core files, wp-content, uploads, plugins, themes, wp-config.php, scheduled tasks, WordPress accounts, and hosting credentials. In uploads, the presence of PHP executables warrants special investigation.

3. Investigate the cause and scope

Review versions, abandoned extensions, plugins installed from unknown sources, administrator users, and FTP/SFTP access. Compare core files with official distributions and look for recent modifications without assuming that any new file is malicious. Evaluate whether the compromise reaches other sites hosted on the same account.

Identify what may have been exposed: personal data, orders, forms, emails, or credentials. If personal data was affected, consult the applicable notification duties in your jurisdiction.

4. Recover in a clean environment

Whenever possible, restore from a verified copy prior to the compromise in an isolated and updated environment. Reinstall core, themes, and plugins from legitimate sources; do not blindly copy code from the infected server. Migrate only the content and data you have reviewed. Rotate passwords, database keys, API keys, and authentication sessions; enable MFA and review SSH keys and DNS panel.

Test forms, links, orders, and transactional emails before redirecting traffic. Verify that no suspicious cron tasks, users, or backdoors remain.

5. Prevent a second infection

Apply updates with a testing process, automatic external backups, and periodically rehearsed restorations. Reduce privileges, uninstall inactive extensions, limit administrator access, and monitor file changes and availability. A WAF can add a layer, but it does not replace updates.

Sign of successful recovery: in addition to loading the website, business operations must work, and the probable cause, changes, and follow-up plan must be documented.

Frequently asked questions

### Is reinstalling WordPress enough? No: compromised users, plugins, database, or credentials may persist.

Should I delete the database?

Not without evaluation and a copy. It may contain essential legitimate data.

Can I use yesterday's backup?

Only after checking if the attack was already present then.

Resources and help

Also read how a CVE vulnerability works and the example of a critical flaw in a WordPress plugin. If you need to rebuild a compromised WordPress or migrate it to isolated infrastructure, ArduMaker can serve as a basis for a recovery and maintenance plan. Reference: official WordPress hardening guide.

  • WordPress
  • malware
  • seguridad
  • recuperación
  • backups

On ArduMaker

  • WordPress and WooCommerce: Sites, WooCommerce stores and Elementor on your VPS, with one-click backups and moving in from your current host.
  • Automatic backups: A full live backup every week, the last 2 kept, and a final copy when you delete the VPS.

Keep reading

All articles · VPS plans