CalculatorFree mockup
Proofsite Blog · guide

WordPress site compromised – immediate steps for the first hour and ways to stop it happening again.

Foreign redirects, Google spam, browser alerts, hosting emails about malicious code – a WordPress breach can appear in many forms, yet the remedy follows a set sequence. We'll walk you through each stage.

WordPress site after a hack, browser warning screen and tools to remove malicious code

How to spot a breach

  • The site sends visitors to overseas pages (casinos, pharma, \"you won a phone\"), sometimes just on mobile or only via Google listings, leaving the owner who opens a bookmark with a blank page.
  • Google displays your domain in Japanese, showing pill or shoe brand pages that you never built.
  • The browser flashes a red warning – \"This site may be dangerous\" – and Search Console adds an alert in the \"Security Issues\" report.
  • Your host either suspended the account or emailed a list of files containing malicious code.
  • Within the WordPress admin you spot an unexpected admin user, or a plugin whose name mimics a core system component.
  • The site begins spamming – hundreds of emails fly out from your domain, and your normal messages start landing in recipients’ spam folders.
  • The site suddenly lags or the server flags high CPU usage, often caused by a script mining crypto or launching attacks on other sites.

First hour: eight steps

  1. Avoid deleting files at random. Start by taking a complete backup of the files and database as they are now. You’ll need that copy to investigate the intrusion and to restore if the clean‑up causes issues.
  2. Change passwords: for the WordPress admin (all admins), FTP/SFTP, the database (update wp-config.php), and the hosting panel. If the same password was used elsewhere, change it there too.
  3. Review the user roster. Delete any admin accounts you don’t recognise. Confirm the email details of legitimate users, because attackers frequently change the address to hijack passwords.
  4. Compare files with a clean version. The WordPress core, themes and plugins from the official repo can be compared file‑by‑file with the original. Any difference is suspicious. Tools: WP‑CLI (wp core verify-checksums, wp plugin verify-checksums --all) or a scanning plugin.
  5. Find files that shouldn't be there: PHP files in the uploads folder, randomly‑named files in the root folder, a modified .htaccess with redirects, code in wp-config.php outside the configuration. Search by recent modification dates and by common functions (base64_decode, eval) in files where they don't belong.
  6. Inspect the database: look at the options table (site URL, active plugins), scan post content for scripts, and review the users table.
  7. Bring everything up to date: WordPress core, theme, plugins and the host’s PHP version. Delete any plugins or themes you’re not using, active or not; a dormant plugin with a flaw still sits on the server.
  8. Test from an external view: load the site in an incognito tab on a mobile device and via Google search results, review the security report in Search Console, and run an outside scanner.

Removing a Google alert

If Google spots malicious code or spam on your site, the Search Console \"Security Issues\" report lists a description and sample URLs. Once you’ve cleaned the site, send a review request and include a short note on what you fixed. Google typically reviews this within a few days, and the browser warning clears after verification. Should the hack have created thousands of spam pages, they will return a 404 or 410 after you remove them; Google will later drop them from the index, and manually deleting them in Search Console speeds up removal for key URLs.

From which places they normally arrive

Our cleanup data shows that, in most cases, the breach follows one of four routes:

  • Out‑of‑date plugin or theme with a known public vulnerability. Bots crawl the internet for particular versions and automatically exploit them, no human needed. It’s the top cause.
  • Weak admin password or an \"admin\" account whose password has been leaked.
  • “Premium for free” theme or plugin sourced from an unofficial site, containing a hidden backdoor.
  • Another site on the same hosting account, that was already compromised. With shared hosting, files from one site can reach another.

Post‑cleanup security

WordPress.org provides a guide on hardening installations. Combining that with real‑world experience yields a brief checklist that blocks most automated attacks:

  • Core security auto‑updates are turned on, and we refresh plugins and the theme weekly.
  • Admins must use two‑factor login, we cap login attempts, and the admin account uses a non‑"admin" username.
  • File editing from the dashboard disabled (DISALLOW_FILE_EDIT), PHP execution in the uploads folder blocked.
  • Each hosting account holds a single site, providing isolation.
  • We run daily off‑site backups and perform a restore test every quarter.
  • Regular monitoring—by a person or automated tool—keeps an eye on the site, since owners usually spot breaches weeks later when Google traffic falls.

Guidance on client communication and privacy legislation (GDPR / Privacy Act).

When a site includes a contact form, user accounts or an online store, a hack may leak personal details—names, emails, phone numbers, order histories. Under privacy law (GDPR / Privacy Act) you must first assess if a data breach happened, then report it to the appropriate regulator within 72 hours of finding it, and if the risk to individuals is high, inform those affected. This isn’t legal advice; it simply notes that fixing the site won’t resolve matters if customer data was kept.

In practice, save a copy of the compromised site (step 1 above) as evidence, record when you spotted the breach and what you discovered, and review server logs for any database pulls. If the shop stored customer passwords (WordPress hashes them, though hashes can be cracked), force every user to reset their password after cleaning. Draft a brief, factual notice for customers covering the incident, the data at risk, the actions you took and what they should do (reset passwords, watch for odd emails). Write this yourself before a browser warning appears for visitors.

What’s the fee for cleaning?

Our post‑hack WordPress cleaning is priced per site; see the WordPress emergency page for rates. We back up before we start, strip malicious code from files and the database, update core, theme and plugins, rotate passwords and keys, report any Google warnings, and provide a checklist of security steps. If you’d like ongoing care after the fix, the Care packages begin at A$59/month and cover updates, backups and monitoring. You can also purchase standalone uptime monitoring for a modest monthly charge.

When a site needs cleaning repeatedly and the infection keeps coming back, it typically points to a backdoor hidden in a theme, plugin or another compromised site on the same account. In such situations rebuilding the site from clean files and migrating just the content is usually more cost‑effective than a fourth clean‑up.

Common questions

A mobile‑only redirect to a different site – is that a hack?

Very likely, yes. Bad code frequently tests if the visitor is on a phone or arrived via Google, then triggers the redirect, leaving a desktop‑browsing owner unaware.

Does restoring a backup solve the problem?

It only works when the backup predates the breach and you understand how the intrusion happened. Restoring a copy that still contains the vulnerable plugin will cause reinfection within days. Once restored, patch everything and reset passwords.

What is the timeframe for Google to clear the "This site may be dangerous" warning?

When you tidy the site and file a review request via Search Console, Google typically needs a few days. If any malicious code remains, the request is denied and you must clean again.

Will a hack cause my Google rankings to drop?

While the warning is active, Google traffic plummets to near‑zero as users steer clear. After the alert is cleared, rankings generally bounce back in a few weeks, assuming the spammy pages are gone.

What price tag is attached to cleaning a virus from a WordPress site?

We charge a fair price for a single site – backup before we start, updates, password resets and a Google report included. Ongoing maintenance – updates, backups and monitoring – starts at A$59/month.

Where our pricing and data come from

The market figures are indicative, sourced from the references above and verified on 8.10.2026. Our rates are taken from the up‑to‑date aussitelab.pro list and are non‑negotiable.

Post‑hack clean‑up at a fair price →

Read also

Get my free mockup