WebGee DocsDocs
Security & SSL
Free migration + 30-day money-backSee how

Clean malware from your website

Remove an infection and close the hole it came through, in the order that stops it returning within days.

Recover a compromised website. Applies to shared, reseller and Premium hosting.

Removing the malicious files is not the job. They got in through something — an outdated plugin, a stolen password, a vulnerable theme. Clean the files without closing that hole and the site is reinfected within days, often within hours. Work through all of the steps below, in order.

1. Take a backup of the current state

Even infected. You may need to compare against it, and restoring the wrong backup is worse than having both — see Take a snapshot backup.

2. Find out what is infected

Scan the account: Scan your site for malware. The results list each affected file.

3. Replace, do not repair

Delete infected files. For anything the site needs, replace it with a fresh copy rather than trying to strip the malicious code out:

  • WordPress core — reinstall from Dashboard → Updates → Reinstall.
  • Plugins and themes — delete each one entirely and install a fresh copy. Updating over an infected plugin frequently leaves the injected code behind.
  • Your own files — restore from a backup predating the infection.

Anything you no longer use, delete rather than reinstall. Abandoned plugins and old theme copies are a common entry point precisely because nobody updates them.

4. Change every password

All of them, because you do not know which was taken:

  • cPanel
  • The site's admin accounts
  • Database users — remember to update wp-config.php to match
  • FTP and SSH accounts
  • Email accounts on the domain

5. Look for what the attacker left behind

Cleaning files misses persistence mechanisms:

  • Unknown admin users in WordPress. Delete any you do not recognise.
  • Scheduled tasks — check cPanel → Cron Jobs for entries you did not create.
  • Mail forwarders and filters — check cPanel → Forwarders and Email Filters.
  • .htaccess files with unexpected redirects, including in subdirectories.

6. Update everything

Run the newest PHP version your site supports — Change your PHP version — and update the CMS, themes and plugins. Old PHP versions stop receiving security fixes.

7. Clear the Google warning

If visitors see "Deceptive site ahead", the site stays flagged until Google re-checks — see Request a Google review.

If it comes back

The entry point is still open. At that stage it is worth paying a specialist — repeated reinfection usually means either a backdoor that was missed, or a compromised machine re-uploading through legitimate credentials.

On this page

Hosted elsewhere?

Cloud Hosting

cPanel on NVMe storage, with LiteSpeed, free SSL and daily backups included.

See plansFree migration