Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Security · Explainer

What to Do in the First Hour After a WordPress Hack

Short answer

In the first hour after a WordPress hack, document what you see, take the site offline, save a copy of the infected site, change every password and secret key, and notify your host. Do not delete files or restore a backup yet. Those first steps contain the damage and preserve the evidence needed to find how the attacker got in.

Key takeaways

  • Document the signs, the time you noticed them, and recent changes before you change anything.
  • Take the site offline with a 503 response served from outside the infected folders.
  • Save a copy of the infected site and label it infected before any cleanup starts.
  • Change every password and replace the secret keys in wp-config.php to log out all users.
  • Check the Security Issues report in Search Console and only request a review after the site is clean.
  • Change all passwords a second time after cleanup, because a password changed during the hack can be captured again.

How do you know your WordPress site was hacked?

A hacked WordPress site shows clear signs, such as a blacklist warning, a host suspension, or new admin users you did not create.

WordPress.org lists these signs as indicators of compromise in its FAQ My site was hacked. The list includes a site blacklisted by Google or Bing, a host that disabled the site, a flag for distributing malware, and visitors whose antivirus software warns them.

Other signs are less visible. Your site may send spam, redirect visitors, or show pages you did not write. A search with the site: operator can reveal unknown pages, as Google Search Central explains in its guide to preventing malware infection.

Treat a strong sign as a hack until you prove otherwise. Waiting to be sure lets an attacker keep working while visitors reach the bad pages.

What should you do in the first 10 minutes?

In the first 10 minutes, stay calm, write down what you see, and note the time and your time zone.

WordPress.org calls documentation the first actionable step after a compromise. Record what made you think the site was hacked, when you noticed it, and what changed recently, such as a new plugin, a theme change, or a new user.

That note becomes the baseline of an incident report. Your host or a cleanup service will ask for it, and it helps you track what changed later.

Do not delete files, remove users, or restore a backup in this window. Deleting evidence before you know what happened can hide the way in.

How do you take a hacked site offline safely?

Take the site offline so it stops serving harmful pages to visitors while you work.

Google's web.dev guide on quarantining your site says to stop the web server or point DNS to a static page on a different server that uses a 503 response code. The 503 response should come from outside the infected folders.

A 4xx or 5xx status alone is not enough, because harmful content can still be returned with those codes. A robots.txt block is also not enough, since it only blocks search crawlers and not regular visitors.

Ask your host to set this up if you are unsure how. Your host can serve the 503 page and help you switch the site on and off for short tests later.

Why should you save a copy before you clean anything?

Save a copy of the infected site first, because cleanup can destroy the evidence that shows how the attacker got in.

WordPress.org recommends one more snapshot of the environment before cleaning, even if it is infected. If cleanup fails, that bad copy gives you a reference to fall back on.

Google's web.dev guide on cleaning and maintaining your site goes further: if you have no backup, make two backups of the infected site. Label each one infected so no one restores it by mistake.

Store the copy away from the live site. A copy on the same infected server can be changed or deleted by the same attacker.

Which passwords and accounts should you change first?

Change every access point, not just the WordPress admin password, and remove any admin users you do not recognize.

WordPress.org names four access points in its FAQ My site was hacked: FTP or SFTP, WP-Admin, cPanel or another hosting panel, and MySQL. Change them for every user with access, not only for yourself.

Check Users, then All Users, and filter by Administrator. Write down any unknown account names for later study, then delete those accounts so the attacker cannot log in again.

A new password alone does not end a session the attacker already holds. Replace the secret keys in wp-config.php with a fresh set from the WordPress key generator, as WordPress.org directs.

Developer.WordPress.org explains that changing these keys invalidates all existing cookies, so every user must log in again. That step logs out the attacker as well as your own team.

Who should you notify in the first hour?

Notify your hosting provider first, then tell the people who may be affected if customer data was exposed.

WordPress.org says to check with your host because the hack may affect more than your site, mainly on shared hosting. Your host can confirm whether it is a real hack, check server logs, and tell you if other sites on the same server are at risk.

Your host may also warn you about email blacklisting. WordPress.org notes that sites abused to send spam can get the server IP flagged, and that IP is often shared with email service on the same server.

If the site collects customer or payment data, pause before you delete anything. Google's web.dev guide on cleaning and maintaining your site says to consider any business, regulatory, or legal duties if personal information was obtained.

For a store or a site with member data, read the GDPR compliance guide for WordPress to see which duties may apply to your site. Do not guess at notification deadlines; get advice if personal data may have leaked.

How do you check what Google and visitors see?

Open the Security Issues report in Search Console to see what Google found, and run a remote scan to see what visitors see.

Google Search Central says the Security Issues report shows any hacked pages Google has found on your site, with steps to fix the problem. If Google found malware, you will also see a notice in the Search Console message panel.

A remote scanner checks the site from the outside. Sucuri SiteCheck checks a URL for known malware, blacklist status, website errors, and out-of-date software. It only sees what a visitor sees, so it cannot check files on the server.

That limit matters. A clean remote scan does not prove the server is clean, so pair it with a server-side scan later. The full malware-removal work is a separate job from this first-hour response.

How do you decide between restoring a backup and cleaning files?

Restore only from a backup made before the hack started, and only after you know when the hack began.

Google's web.dev guide on cleaning and maintaining your site says to check first that your backup was created before your site was hacked. A backup made after the hack can restore the infection with the site.

If you have a clean backup, restoring it is often the fastest route back. Follow the steps in how to restore a backup with UpdraftPlus if that is the tool you use, and keep the infected copy you saved earlier.

If you have no clean backup, the site needs file-by-file cleanup. WordPress.org says you can safely replace the /wp-admin and /wp-includes folders with fresh copies of the same version, and check .htaccess plus index.php, header.php, footer.php, and functions.php.

Do not use the reinstall option in WP-Admin for this step. WordPress.org warns that those installers often only overwrite existing files, while hacks often add new files.

When should you ask Google to review the site?

Ask Google for a review only after the site is clean, the hole is fixed, and the clean site is back online.

Google's web.dev guide on requesting a review lists four checks before you ask: verified ownership in Search Console, a cleaned site, a corrected vulnerability, and a clean site back online. Asking too early can prolong the time the site stays flagged.

Review times differ by issue type, as of November 2026. Web.dev says hacked-with-spam reviews can take up to several weeks, malware reviews take a few days, and phishing reviews take about a day.

If Google finds the site clean, warnings in browsers and search results are removed within 72 hours. If it is not clean, the report may show more sample infected URLs to help your next check.

What mistakes should you avoid?

Avoid deleting evidence, restoring an untested backup, and changing passwords only once.

Deleting files before you save a copy removes the trail that shows the entry point. Restoring the first backup you find can bring the infection back if that backup was made after the hack.

Changing passwords once is not enough. WordPress.org says to change the passwords again after the site is clean, because a password changed while an attacker still had access can be captured again.

Speed also matters for the entry point. Patchstack counted 11,334 new WordPress vulnerabilities in 2025, up 42% on 2024, with 91% in plugins and only 6 in WordPress core, in its State of WordPress Security in 2026.

Patchstack also found that 46% of those flaws had no developer fix at disclosure, and that the weighted median time to mass exploitation for heavily targeted flaws was 5 hours. That is why the first hour is for containment, not for a slow search for the perfect fix.

First-hour stepTimeDone when
Document signs and time0 to 10 minutesYou have a written note with times and recent changes
Take the site offline10 to 20 minutesVisitors see a 503 page served from outside the infected folders
Save an infected copy20 to 30 minutesFiles and database are copied off the live server and labelled infected
Change passwords and keys30 to 50 minutesAll access points are changed and unknown admins are removed
Notify host and check Google50 to 60 minutesHost is told and the Security Issues report is read

If the job is bigger than your skills, get help early. The cost of a hack cleanup explains what professional cleanup usually costs, so you can decide fast instead of losing hours to a job you cannot finish safely.

Frequently asked questions

Should I delete hacked files as soon as I find them?

No. Save a copy of the infected site first and label it infected, then document what you found. Deleting files before you have a copy can destroy the evidence that shows how the attacker got in and remove content you may need to restore.

Can I just restore my latest backup and be done?

Only if that backup was made before the hack started. A backup made after the hack can restore the infection. Check the backup date against the first sign of the hack, keep your infected copy, and change all passwords again after the restore.

Why do I need to change passwords twice?

The first change locks the attacker out of accounts you still control. The second change happens after cleanup, because a password set while the attacker still had access could have been captured. Replace the secret keys in wp-config.php too, so all sessions end.

How long does it take Google to remove a hacked-site warning?

It depends on the issue. Hacked-with-spam reviews can take up to several weeks, malware reviews take a few days, and phishing reviews take about a day. Once Google finds the site clean, warnings are removed within 72 hours.

My site looks fine to me but Google says it is hacked. What should I do?

Trust the warning and check the Security Issues report in Search Console for the sample URLs Google found. Hackers often hide spam so only Googlebot or some visitors see it. Do not keep browsing the site from your usual computer while you check.

Should I tell my customers in the first hour?

Tell your host first, then assess whether customer data was exposed before you send a public message. If personal data may have leaked, get advice on your legal duties before you delete files. A short note that the site is down for review is enough until you know more.

Sources

  1. FAQ My site was hacked WordPress.org
  2. Quarantine your site web.dev
  3. Request a review web.dev
  4. Clean and maintain your site web.dev
  5. How to prevent malware infection Google Search Central
  6. State of WordPress Security in 2026 Patchstack
  7. wp-config.php Developer.WordPress.org
  8. Sucuri SiteCheck Sucuri

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test