In short
- Don't delete everything at once. First isolate the site, make a copy in its infected state and write to your hosting provider.
- Change passwords twice: immediately after you detect the problem and again after the cleanup. All of them: hosting, FTP/SFTP, database, CMS administrators, email.
- A clean backup is the fastest route, but only if it is older than the hack. Otherwise you clean a copy, not the live server.
- If the "hole" isn't closed, the hack will happen again. Most often it's an outdated plugin, theme or PHP, or a stolen password.
- Google's warning is lifted after a review request in Search Console: malware takes a few days, spam up to a few weeks.
- Cleaning a hacked site at WebLift is $50. If the site is badly damaged or there is no backup, we assess it separately and name the price before work begins.

Your site opens with someone else's ads, Google says "dangerous site", and your hosting provider sent an email about malicious code. This is a hack, and it can be cured. The main thing is not to make sudden moves in the first minutes: don't delete files at random and don't restore the first copy you find.
Below is the order of actions, put together from Google's official instructions for hacked sites and the WordPress documentation. No technical details of attacks: only how to check, remove and prevent a repeat. We are a web studio, so at the end we are honest about when to clean and when it is simpler to build the site again.
Signs of a hack: symptom and what it means
The most reliable signs of a hack are a Google warning in search or the browser, an email from your hosting provider about malicious code, and pages or administrators you didn't create. The other symptoms are only a reason to check.
| Symptom | What it usually means | Where to check |
|---|---|---|
| In search, the line "This site may be hacked" appears under your site | Google found foreign pages or altered content on the site | Search Console → "Security issues" |
| Chrome shows a red "Dangerous site" or "Deceptive site ahead" screen | Safe Browsing flagged the site: malware or phishing | Checking the site status in Google Transparency Report |
| From search or from a phone a casino or another site opens, while from a bookmark it is yours | A hidden redirect for only some visitors | URL Inspection in Search Console. Don't open the infected page from the computer you use to log into the admin panel |
A site:your-domain search shows pages in Japanese, pills, casinos | Spam pages created by an attacker | site: in Google, the "Pages" report in Search Console |
| The page is empty in the browser, but there's spam under it in search | Cloaking: robots are shown one thing, people another | The URL Inspection tool in Search Console |
| New WordPress administrators that you didn't add | Someone has access to the panel | "Users" in the admin panel, the users table in the database |
| The host blocked the site or wrote about malicious code or spam mailing | The server is being used for mailings or attacks | The host's email, logs, files with a recent modification date |
| Emails from your domain go to spam, customers complain about strange emails | The domain or IP landed on blacklists because of mailings | Support of your hosting and email provider |
| A visitor's antivirus blocks the site | The pages contain a malicious script | VirusTotal, a scanner plugin |
| The site is suddenly slow, server load is at maximum | A third-party script, mass mailing or password guessing | Resource statistics in the hosting panel |
One sign doesn't yet prove a hack. A white screen or a "critical error" after an update is more often a breakage than an attack: we explained how to fix it in the article "Critical error on a WordPress site".
- A Google warning in search or a red Chrome screenCheckThe "Security issues" report in Search Console, the status in Transparency ReportA hack. Follow the 6 steps below
- The host disabled the site, visitors' antivirus programs block itCheckThe host's email and logs, files with a recent modification dateA hack. WordPress counts this among the clear signs
- Foreign pages in
site:or administrators you didn't addCheckThe "Pages" report in Search Console, "Users" in the admin panel and in the databaseA hack: spam pages or someone else's access - A redirect or foreign ads only from search or from a phoneCheckURL Inspection in Search Console. Don't open the page from the computer you use to log into the admin panelProbably injected code
- A white screen or a "critical error" right after an updateCheckThe PHP error log, the WordPress recovery mode emailMore often a breakage, not a hack
Text version of the diagram
- A Google warning or a red Chrome screen → check "Security issues" and Transparency Report → a hack, follow the 6 steps.
- The host disabled the site, antivirus programs block it → the host's email and logs, recently changed files → a hack.
- Foreign pages in site: or new administrators → the "Pages" report, the list of users → a hack: spam or someone else's access.
- A redirect or ads only from search or a phone → URL Inspection in Search Console → probably injected code.
- A white screen after an update → the PHP error log, the recovery mode email → more often a breakage.
The first 30 minutes: 6 steps
The first 30 minutes are for isolating the site, preserving evidence, changing access credentials and involving your hosting provider. Cleaning comes later. Haste at this stage usually destroys the copies you could have restored from.
- Write down what you see and delete nothing
The time you noticed the problem, screenshots of the warnings, addresses of suspicious pages. Recall what you changed last: a new plugin, a theme, access given to a contractor. This will be useful to you and to whoever cleans the site.
- Isolate the site from visitors
Ask your host to serve a maintenance page with a 503 code from outside the infected folders, or temporarily disable the site in the panel. A maintenance-mode plugin on the infected site itself won't do: the response must come from outside. Google specifically warns: a robots.txt block does not protect visitors; it only closes the site to robots.
- Make a copy in its current state
Files and database, separately from the server, labelled "infected" and dated. Don't overwrite old backups with it. See which copies your host keeps and for which dates: a clean copy may still be found.
- Write to your host
On shared hosting a hack may affect neighbouring sites. Support can tell you when the changes began, provide logs and old copies, and sometimes already knows how the attacker got in.
- Change all passwords from a clean device
Hosting, FTP/SFTP, the database, all CMS administrators, email on the domain, the domain registrar. Delete unknown administrators, but note their logins. In WordPress, refresh the secret keys in wp-config.php: this ends all foreign sessions. If you change the database password, enter the new one in wp-config.php, or the site won't open.
- Check your own computer
The WordPress documentation reminds us: FTP and admin passwords are often stolen from the owner's computer. Scan it with antivirus, or the new passwords will leak the same way.
After the cleanup, change the passwords once more. Both Google and WordPress advise this: if the attacker left a backdoor, he may have already seen the first new passwords.
30 minutesStop the damage
- write down symptoms and time
- close the site: 503 from outside, not from the infected server
- a copy labelled "infected"
- email the host
- passwords and wp-config keys — first time
- antivirus on your own computer
24 hoursClean up and close the entry point
- find how they got in
- a clean backup older than the hack, or clean a copy
- update the CMS, plugins, theme, PHP
- remove what's unnecessary and foreign admins
- passwords — second time
- bring the site back and check the pages
A weekRestore trust
- a review request in Search Console
- foreign addresses return 404
- appeal rejected Google Ads ads
- backups off the server
- Search Console alerts by email
A review after a spam hack can take a few weeks
Text version of the plan
- 30 minutes — stop the damage: write down the symptoms, close the site with a 503 response from outside the infected server, make an "infected" copy, write to the host, change passwords and wp-config keys, check your own computer.
- 24 hours — clean up and close the entry point: find the vulnerability, restore a clean backup or clean a copy, update the CMS, plugins, theme and PHP, remove what's unnecessary and foreign admins, change passwords a second time, bring the site back online.
- A week — restore trust: a review request in Search Console, 404 for foreign addresses, an appeal for Google Ads ads, backups off the server, Search Console alerts. A review after a spam hack can take a few weeks.
How to find and remove malicious code
The cleanup route depends on the backup. If there is a clean copy older than the hack, you restore it and update everything. If there is no copy, you clean a copy of the site, not the live server, and only then transfer it. In both cases you have to find and close the cause of the hack.
- What to do
- restore the copy, update the CMS, plugins, theme and PHP, close the cause
- Check
- that the copy is older than the hack
- Risk
- minimal
- What to do
- save the infected copy, restore the clean one, update everything
- Then
- transfer new articles, products, orders — verified content only
- Risk
- losing some changes
- What to do
- two copies of the infected site, clean a copy, not the live site
- What gets cleaned
- files, database, permissions, foreign accounts
- Risk
- missing a backdoor and getting infected again
WordPress: what is checked first
- The core. The WP-CLI command
wp core verify-checksumscompares WordPress files with the official ones and shows the changed ones; with the--include-rootflag it also warns about foreign files in the root. Thewp-adminandwp-includesfolders are replaced with clean files of the same version via SFTP, not with the reinstall button in the admin panel: it overwrites files but doesn't remove new ones added by the attacker. - Plugins.
wp plugin verify-checksums --allchecks plugins against the wordpress.org directory. Paid plugins and "free versions of paid ones" (nulled) can't be checked this way: they are reinstalled from the official source or deleted. - The files changed most often.
.htaccess(in the root and in subfolders),index.php,wp-config.php, and in the themeheader.php,footer.php,functions.php. - The uploads folder.
wp-content/uploadsshould contain images and documents. A PHP file there is almost always foreign. - The database. Foreign administrators, scripts inserted into posts and widgets, changed site addresses in the settings, unknown scheduled tasks.
- Extras. Inactive plugins and themes are deleted: they don't run, but their vulnerabilities remain on the server.
For a first look, the WordPress documentation advises combining an on-site scanner (for example Wordfence or Sucuri) and an external one (VirusTotal, Sucuri SiteCheck). A scanner finds what is known, but doesn't guarantee that everything has been removed: backdoors are often disguised as ordinary files.
A site not on WordPress: OpenCart, Laravel, custom PHP
The principle is the same. Compare the files with a clean copy or a Git repository: anything that changed without your knowledge is suspicious. Look at files with a recent modification date, PHP scripts in upload folders and long incomprehensible lines of code. The CMS core and libraries are installed again from official sources, of the same version.
Find out exactly how they got in
In its "Identify the vulnerability" guide Google says plainly: if you don't close the vulnerability, the site will be infected again. The most common causes we see:
- a plugin or theme with a known vulnerability that hasn't been updated for a long time;
- an old PHP version. On October 21, 2026 PHP closed two critical vulnerabilities that allow foreign code to be executed without a login — see the breakdown in the article "php2shell: a critical PHP vulnerability";
- a stolen or simple password, a shared "admin" account for everyone;
- nulled plugins, that is, cracked copies of paid ones, in which a backdoor is often already built in.
Plugins and themes
91% of new WordPress vulnerabilities in 2025 were in plugins, 9% in themes, and only 6 were found in the core, all of low priority. 46% of vulnerabilities had no fix from the author at the time of disclosure. Patchstack
Outdated CMS and components
39.1% of CMS on hacked sites were outdated at the time of infection. 13.97% of sites had at least one vulnerable plugin or theme, 4.18% had a fake plugin. Sucuri
Old PHP
34.2% of WordPress sites run on PHP 8.1 and older, for which there are no security fixes any more. Another 23.3% are on 8.2, whose support ends on 12/31/2026. WordPress.org, php.net
Passwords and access
Sources do not publish the share of hacks through passwords
FTP and admin passwords are often stolen by trojans from the owner's computer. In 55% of sites with malicious code in the database there was a foreign administrator — this is how the attacker returns after a cleanup. WordPress, Sucuri
Hosting
Sources do not publish the share of hacks through hosting
On shared hosting a hack can affect more than just your site, so you write to your host right away. WordPress
Text version of the data
- Plugins and themes: 91% of new WordPress vulnerabilities in 2025 were in plugins, 9% in themes, 6 in the core; 46% had no fix at the time of disclosure (Patchstack).
- Outdated CMS: 39.1% of CMS on hacked sites were outdated; 13.97% of sites had a vulnerable plugin or theme, 4.18% a fake plugin (Sucuri, 2023).
- Old PHP: 34.2% of WordPress sites on PHP 8.1 and older without security fixes, another 23.3% on 8.2 with support until 12/31/2026 (WordPress.org, Oct 24, 2026).
- Passwords: the share is not published; passwords are often stolen from the owner's computer; in 55% of sites with malicious code in the database there was a foreign administrator (WordPress, Sucuri).
- Hosting: the share is not published; on shared hosting a hack can affect neighbouring sites (WordPress).
Google shows "dangerous site": what to do
The warning is lifted by Google itself after a review request in Search Console. You can submit the request only after a full cleanup: if the problem remains, the warning will hang on longer.
- Verify ownership of the site in Search Console, if you haven't yet. Without it you can't submit a request.
- Open the "Security issues" report. It shows the type of problem — malware, code, content or URL injection, deceptive pages, harmful downloads — and examples of infected addresses. Separately check "Manual actions": for spam pages Google can lower the site in search.
- Check the status in Google Safe Browsing on the Transparency Report page. This is the list Chrome uses when it shows the red screen.
- Remove spam pages from the index. Pages created by the attacker should return 404 after deletion — then Google will remove them from search over time. Use the "Removals" tool only for such foreign addresses, not for your own pages.
- Submit a review request (Request review). Briefly describe what happened, what was done and how the cause was closed.
- Day 0You noticed the hack: isolation, copy, passwords, host
- CleanupRemove the code, close the cause, change passwords again, bring the site back online
- RequestRequest review in the "Security issues" reportthe pages must be open to Googlebot: no robots.txt block and no noindex
- ≈1 dayA review after phishing
- a few daysA review after malware
- up to a few weeksA review after a spam hack
- up to 72 hoursThe warnings in the browser and in search are lifted if the site is found clean
If Google Ads ads pointed to the site, they may have been disapproved with the reason "Compromised site". After the cleanup and removal of the site from the Safe Browsing list through Search Console, they should switch back on automatically; Google Ads allows up to 72 hours to re-check the page. If the ads are still disapproved, submit an appeal with the reason "Made changes to comply with policy" or write to support.
Don't want to figure it out yourself
Cleaning a hacked site — $50
We'll do the steps from this article for you and submit the review request to Google if the site got a warning.
An honest word on price: $50 is the cleanup. If the site is badly damaged, there is no backup, it's an online store or custom code, we assess it separately after an inspection and name the price before work begins. Small extras outside the cleanup are $25 per hour.
Included in $50
- a copy of the site in its infected state
- finding and removing malicious code in files and the database
- replacing the core and plugins with clean files of the same version
- removing foreign administrators
- new secret keys and passwords
- updating the plugins and theme through which the attacker got in
- a review request to Google, if there is a warning
Separate — we name the price before work begins
- a badly damaged site or no backup — assessment after inspection
- an online store or custom code — assessment after inspection
- extras outside the cleanup — $25/hr
- turnkey move to PHP 8.3 or 8.4 — $50
- support after the cleanup — from $59/month
Text version
- Included in $50: a copy of the infected state, removal of malicious code from files and the database, replacing the core and plugins with clean files, removing foreign administrators, new keys and passwords, updating vulnerable plugins and the theme, a review request to Google.
- Separate: a badly damaged site, a site without a backup, a store or custom code — assessment after inspection before work begins; extras — $25/hr; move to PHP 8.3/8.4 — $50; support — from $59/month.
How to prevent a repeat hack
A repeat hack almost always means the cause wasn't closed. Protection rests on four things: updates, a supported PHP version, backups off the server and access credentials that are hard to steal.
| What | How often | Why |
|---|---|---|
| CMS, plugin and theme updates | weekly, first on a copy | most hacks go through known vulnerabilities in old versions |
| PHP version | check once a quarter | PHP 8.2 gets security fixes until 12/31/2026, 8.3 until 12/31/2027, 8.4 until 12/31/2028, 8.5 until 12/31/2029 |
| Backups of files and database | daily, automatic, off the server | a copy on the same server can be infected along with the site |
| Testing restoration from a backup | once every few months | a backup you couldn't restore from is not a backup |
| Passwords and two-factor login | immediately, then whenever people change | a separate account for each person, no shared "admin" |
| Removing the unnecessary | after every project | inactive plugins, old copies of the site in subfolders, access for former contractors |
If your site is still on PHP 8.1 or 7.4, there are no official security fixes for those branches any more. We handle the move to 8.3 or 8.4 as a "PHP update" package: an update to the fixed build from $25 per hour, a turnkey move of a WordPress brochure or corporate site with a backup and a test staging site for $50. Details are on the PHP update page.
What else you lost
While the site was down, you were losing leads. Google Ads brings the flow back faster than search
After a hack a site is often closed for several days, and spam pages and warnings lower it in search. Recovering rankings can take weeks. Search advertising brings traffic from the first day after moderation: it is seen by people who are already looking for your service.
If you were already running ads and they were stopped because of "Compromised site", first the site has to be cured, and then the account checked: where the budget went, which queries, whether leads are tracked. We audit ad accounts for free. And so that leads aren't lost the next time the site is unavailable, they can be duplicated to Telegram: a starter lead bot is $90 instead of $150.
When it's simpler to rebuild the site
A site is worth curing if it is kept updated and has a living foundation. If the CMS, theme and PHP are years out of date and the hack keeps repeating, cleaning only postpones the next one. Then a new site comes out cheaper than a series of cleanups.
| Situation | Cure | Rebuild |
|---|---|---|
| The first hack, the CMS and plugins are kept updated | yes | — |
| There is a clean backup, the site is on a supported PHP version | yes | — |
| The theme or plugins are abandoned by the developer, no updates for years | temporarily | worth it |
| The site doesn't run on PHP newer than 7.4 | temporarily | yes |
| The hack keeps repeating after cleanups | — | yes |
| No backup, no admin access or source code, the contractor has vanished | by assessment | often cheaper |
For old sites
A new site instead of a third cleanup
We transfer the texts, photos and page addresses so you don't lose rankings in Google, and launch on fresh PHP with backups from day one. For a small business a landing page with a form is often enough; for a company with several services, a corporate website.
Questions and answers
What should I do if my website was hacked?
How can I tell that my website was hacked?
Why does Google say my site is dangerous?
How long does it take Google to lift the "dangerous site" warning?
My site is infected with a virus — can I just restore a backup?
Will a security plugin help if the site is already hacked?
Why was my site hacked again after cleaning?
How much does it cost to clean a hacked website?
Is the hosting provider to blame for my site being hacked?
Do small brochure sites get hacked?
Read also
The order of actions is based on Google's official guides for hacked sites, the Search Console help and the WordPress documentation as of Oct 24, 2026. The article contains no technical details of attacks. If customer data was affected, consult a lawyer about next steps; a cyber incident can be reported to CERT-UA.
Primary sources
- Google — Help, I think I've been hacked (a guide for hacked sites) (Oct 24, 2026)
- Google — How do I know if my site was hacked? (Oct 24, 2026)
- Google — Quarantine your site (Oct 24, 2026)
- Google — Identify the vulnerability (Oct 24, 2026)
- Google — Clean and maintain your site (Oct 24, 2026)
- Google — Request a review: conditions and review times (Oct 24, 2026)
- Search Console Help — the "Security issues" report (Oct 24, 2026)
- Google Transparency Report — checking a site's Safe Browsing status (Oct 24, 2026)
- Google Ads policy — Compromised sites (Oct 24, 2026)
- WordPress — FAQ My site was hacked (Oct 24, 2026)
- WordPress — Hardening WordPress (Oct 24, 2026)
- WordPress — Backups (Oct 24, 2026)
- WP-CLI — wp core verify-checksums (Oct 24, 2026)
- WP-CLI — wp plugin verify-checksums (Oct 24, 2026)
- PHP — Supported Versions: branch support periods (Oct 24, 2026)
- Patchstack — State of WordPress Security in 2026 (2025 data) (Oct 24, 2026)
- Sucuri — 2023 Hacked Website & Malware Threat Report (Oct 24, 2026)
- WordPress.org — PHP version statistics for WordPress sites (Oct 24, 2026)
- CERT-UA — Ukraine's government computer emergency response team (Oct 24, 2026)