Skip to content
Website security

Your website was hacked: what to do in the first 30 minutes, how to remove the malware and clear Google's warning

Published: Oct 25, 2026Updated: Oct 25, 2026Sources checked: Oct 24, 2026Read: 14 minAuthor: Volodymyr, co-founder of WebLift

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.
A paper website window with a crack patched with orange patches, next to a paper shield, a wrench and a padlock — WebLift illustration for the article on a hacked website

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.

SymptomWhat it usually meansWhere to check
In search, the line "This site may be hacked" appears under your siteGoogle found foreign pages or altered content on the siteSearch Console → "Security issues"
Chrome shows a red "Dangerous site" or "Deceptive site ahead" screenSafe Browsing flagged the site: malware or phishingChecking 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 yoursA hidden redirect for only some visitorsURL 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, casinosSpam pages created by an attackersite: in Google, the "Pages" report in Search Console
The page is empty in the browser, but there's spam under it in searchCloaking: robots are shown one thing, people anotherThe URL Inspection tool in Search Console
New WordPress administrators that you didn't addSomeone 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 mailingThe server is being used for mailings or attacksThe host's email, logs, files with a recent modification date
Emails from your domain go to spam, customers complain about strange emailsThe domain or IP landed on blacklists because of mailingsSupport of your hosting and email provider
A visitor's antivirus blocks the siteThe pages contain a malicious scriptVirusTotal, a scanner plugin
The site is suddenly slow, server load is at maximumA third-party script, mass mailing or password guessingResource 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".

The site is behaving strangely: what to check first
A decision tree based on Google's guides and the WordPress documentation
The site is behaving strangely
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
The first three branches are grounds to act as for a hack. Google warns that an infected page can harm a computer, so check it with tools, not with the browser you use to manage the site.
Text version of the diagram
  1. A Google warning or a red Chrome screen → check "Security issues" and Transparency Report → a hack, follow the 6 steps.
  2. The host disabled the site, antivirus programs block it → the host's email and logs, recently changed files → a hack.
  3. Foreign pages in site: or new administrators → the "Pages" report, the list of users → a hack: spam or someone else's access.
  4. A redirect or ads only from search or a phone → URL Inspection in Search Console → probably injected code.
  5. 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

Action plan: 30 minutes, 24 hours, a week
The actions come from Google's and WordPress guides; the split by time is a WebLift guideline

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

The first 30 minutes are not for cleaning the site but for stopping the damage and saving copies. Cleaning without closing the cause is the most common route to a repeat hack.
Text version of the plan
  1. 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.
  2. 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.
  3. 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.

Three recovery scenarios
Following Google's "Clean and maintain your site" instructions
There is a fresh clean backup
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
Usuallythe fastest route
The backup is clean but old
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
Importantdon't carry files over from the infected copy blindly
There is no backup
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
Herea separate assessment: the scope is visible only after inspection
Before restoring a backup, make sure it was made before the hack. Otherwise the malicious code comes back with the copy.

WordPress: what is checked first

  • The core. The WP-CLI command wp core verify-checksums compares WordPress files with the official ones and shows the changed ones; with the --include-root flag it also warns about foreign files in the root. The wp-admin and wp-includes folders 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 --all checks 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 theme header.php, footer.php, functions.php.
  • The uploads folder. wp-content/uploads should 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.
Where attackers get in: what the data says
The figures come from different samples and do not add up to 100%. Patchstack — new WordPress vulnerabilities for 2025; Sucuri — sites the company cleaned in 2023; WordPress.org — PHP version statistics as of Oct 24, 2026

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

Most new vulnerabilities are in plugins, and almost half of all vulnerabilities had no fix at the time of disclosure. So updates are necessary but not sufficient: you also need backups off the server and access credentials that are hard to steal.
Text version of the data
  1. 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).
  2. 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).
  3. 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).
  4. 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).
  5. 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.

  1. Verify ownership of the site in Search Console, if you haven't yet. Without it you can't submit a request.
  2. 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.
  3. Check the status in Google Safe Browsing on the Transparency Report page. This is the list Chrome uses when it shows the red screen.
  4. 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.
  5. Submit a review request (Request review). Briefly describe what happened, what was done and how the cause was closed.
How long to wait after a review request
Timeframes from Google's "Request a review" help; the actual time depends on the queue
  1. Day 0You noticed the hack: isolation, copy, passwords, host
  2. CleanupRemove the code, close the cause, change passwords again, bring the site back online
  3. RequestRequest review in the "Security issues" reportthe pages must be open to Googlebot: no robots.txt block and no noindex
  4. ≈1 dayA review after phishing
  5. a few daysA review after malware
  6. up to a few weeksA review after a spam hack
  7. up to 72 hoursThe warnings in the browser and in search are lifted if the site is found clean
The longest wait is after a spam hack — up to a few weeks. So submit the request when the site is completely clean: Google warns that a request while the problem remains only lengthens the time the site stays marked as dangerous.

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.

Cleanup for $50: what's included and what's separate

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
  1. 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.
  2. 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.

WhatHow oftenWhy
CMS, plugin and theme updatesweekly, first on a copymost hacks go through known vulnerabilities in old versions
PHP versioncheck once a quarterPHP 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 databasedaily, automatic, off the servera copy on the same server can be infected along with the site
Testing restoration from a backuponce every few monthsa backup you couldn't restore from is not a backup
Passwords and two-factor loginimmediately, then whenever people changea separate account for each person, no shared "admin"
Removing the unnecessaryafter every projectinactive 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.

Website support from $59 a monthUpdates on a copy, daily backups, availability monitoring, a security check and a monthly report with the hours spent. Before we start, a free technical review, including for signs of a hack.
Choose a plan

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.

SituationCureRebuild
The first hack, the CMS and plugins are kept updatedyes—
There is a clean backup, the site is on a supported PHP versionyes—
The theme or plugins are abandoned by the developer, no updates for yearstemporarilyworth it
The site doesn't run on PHP newer than 7.4temporarilyyes
The hack keeps repeating after cleanups—yes
No backup, no admin access or source code, the contractor has vanishedby assessmentoften 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?

Don't delete anything at random. Write down what you see, isolate the site with a maintenance page, make a copy in its current state, write to your host and change all passwords from a clean device. Then comes the cleanup or restoration from a clean backup, closing the cause of the hack and another round of password changes.

How can I tell that my website was hacked?

The most reliable signs are a Google warning in search or Chrome, an email from your host about malicious code, pages in a site:your-domain search that you didn't create, and unfamiliar administrators. A redirect to someone else's site only from a phone or from search is also a typical sign.

Why does Google say my site is dangerous?

Google Safe Browsing found malware, phishing or harmful downloads on the site, or the site was hacked and spam was added. The type of problem and example addresses are shown in the "Security issues" report in Search Console. You can check the site's status in Google Transparency Report.

How long does it take Google to lift the "dangerous site" warning?

After a review request: phishing — about a day, malware — a few days, a spam hack — up to a few weeks. If the site is found clean, the warnings in the browser and in search disappear within 72 hours. The request is submitted only after a full cleanup.

My site is infected with a virus — can I just restore a backup?

You can, if the copy was made before the hack. But after restoring you must update the CMS, plugins, theme and PHP and change passwords, or the site will be infected again the same way. If the date of the hack is unknown, the backup may also contain malicious code.

Will a security plugin help if the site is already hacked?

A scanner helps find known malicious code and changed files, but doesn't guarantee that everything has been removed. Backdoors are often disguised as ordinary files. So a plugin is an inspection tool, not a replacement for manually checking the core, plugins, database and access credentials.

Why was my site hacked again after cleaning?

Most often the cause wasn't closed: an outdated plugin, an old PHP version, a nulled theme or a stolen password remained, and an unnoticed backdoor on the server. Google directly advises finding the vulnerability before bringing the site back online and changing passwords again after the cleanup.

How much does it cost to clean a hacked website?

At WebLift, cleaning a hacked site costs $50. 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. Ongoing support can be taken from $59 a month.

Is the hosting provider to blame for my site being hacked?

Sometimes, but more often the attacker gets in through the site itself: according to Sucuri, 39.1% of CMS on hacked sites were outdated, and according to Patchstack, 91% of new WordPress vulnerabilities are in plugins. You should still write to your host right away: on a shared server a hack can affect neighbours, and support will provide logs and old copies of the site.

Do small brochure sites get hacked?

Yes. Most hacks are automatic: bots go through sites with known vulnerabilities and simple passwords regardless of the size of the business. A small brochure site is used more often for spam pages, redirects or mailings than for stealing data.

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.

Related WebLift services

If the article answered your question, this is where people usually go next.

Was your site hacked? Write to us — we'll start today

Send us the site address and what you see. We'll take a look and name the price and timeline. The cleanup is $50; if the damage is serious or there is no backup, we'll tell you the price before work begins.

Write to us Website support