Skip to content
Security

What to do in the first hour after a WordPress hack

A calm, ordered plan for the first hour after you discover a hacked WordPress site: contain, preserve evidence, change credentials and call for help.

By WP24×7 engineers6 min readPublished November 29, 2026Updated November 29, 2026

At a glance

In the first hour after discovering a hacked WordPress site, your aims are to stop the damage, keep evidence and lock the doors you can reach. Contain the site, save a copy, change credentials from a clean device and call for help before cleaning. This plan is ordered by minute, with what not to do and what to hand over.

Updated November 29, 2026

  • For owners who have just found their WordPress site hacked
  • Minutes 0 to 10 contain, screenshot, tell your host
  • Minutes 10 to 25 copy files and database, save logs
  • Minutes 25 to 45 change credentials, rotate keys, turn on 2FA
  • Minutes 45 to 60 assess, decide who cleans
  • Do not delete files, restore blindly, or rely on one scanner
  • Help malware removal and emergency support, any hour

In the first hour, your aims are to stop the damage, keep evidence, and lock the doors you can reach. Contain the site, save a copy, change credentials from a clean device, and call for help before cleaning.

If you are not yet sure the site is compromised, start with how to tell if your WordPress site is hacked.

What is the plan at a glance?

WindowAimKey actions
Minutes 0 to 10ContainWrite down what you saw, limit visitors' exposure, tell your host
Minutes 10 to 25Preserve evidenceCopy files and database, save logs, note recent changes
Minutes 25 to 45Change credentialsWordPress, hosting, SFTP, database, email, keys, two-factor
Minutes 45 to 60Assess and get helpCheck other sites, DNS, decide who cleans, write the plan
Contain first, then preserve, then change credentials

Minutes 0 to 10: contain the damage

  1. Stay calm and write down what you saw, with the time. Take screenshots of warnings, redirects and defaced pages. These help whoever cleans the site.
  2. Limit visitors' exposure. If the site redirects, serves malware or shows spam, take it out of public view. Options: maintenance mode, an "under construction" page from your host, or asking your host to suspend public access. If you use a CDN or firewall in front, your provider may have an "under attack" or block mode.
  3. Do not delete anything. Resist the urge to remove odd files or reinstall WordPress. You would lose evidence of how the attacker got in, and may miss other backdoors.
  4. Tell your host. Open a ticket or call. They can see server logs, may have scans, can isolate a site that is attacking others, and may have server-level backups.

Minutes 10 to 25: preserve evidence

  1. Take a full copy of the site files and database as they are now, and store it somewhere other than the server. Label it as compromised so nobody restores it by mistake.
  2. Save the logs you can reach: access and error logs from your host, plus any security plugin or firewall logs. Many logs rotate quickly.
  3. Note recent changes: the last time you updated, who had access and what plugins were added. Look at the Users list and note unknown administrators, without deleting them yet.

Minutes 25 to 45: change credentials

Do this from a computer you trust and that has current security software, since a compromised computer can be how the attacker got in.

  1. Change your WordPress administrator passwords, and log out all sessions. WordPress has a "log out everywhere" option on the user profile screen.
  2. Change the hosting account password, and the SFTP, SSH and database passwords. Your hosting control panel handles this.
  3. Change email passwords for the admin address on the site, since a password reset goes there.
  4. Change passwords for connected services: CDN, DNS provider, payment gateway dashboards, email marketing and API keys stored on the site.
  5. Rotate the WordPress secret keys and salts in wp-config.php, which invalidates existing login cookies. The official generator gives fresh values. Take a backup of the file first, and do not paste keys anywhere public.
  6. Turn on two-factor authentication for your host, registrar and WordPress admins.

If you run a shop, also check payment settings, and tell your payment provider if you suspect card data exposure. Do this early.

Minutes 45 to 60: assess and get help

  1. Check who else is affected. Other sites on the same account share a fate if one is infected. Ask your host.
  2. Check Google Search Console and your domain's DNS settings for unfamiliar entries.
  3. Decide who cleans the site. Cleaning needs finding every backdoor, the entry point, and any injected database content. A partial clean leaves the attacker a way back. A hacked site cleanup specialist or emergency support team does this routinely.
  4. Write the plan: who is responsible, what is offline, and when you will update customers.

What should I not do?

Do notWhy
Pay anyone who contacts you offering to fix the site unpromptedUnsolicited offers are a common trap
Restore the latest backup without checking when the infection beganAn infected backup brings the problem back
Rely on a single scanner plugin to declare the site cleanIt can miss backdoors
Leave the site live while it serves malwareVisitors are exposed
Reuse old passwords with small changesEasy to guess

What should I have ready before it happens?

The first hour is far calmer if some things exist already. A short "break glass" note, kept outside the website itself, makes a large difference:

01Host contact

Who to call, and your account or ticket reference.

02DNS and domain

Where managed, and who can log in.

03File access

How to reach the file manager or SFTP.

04Latest backup

Where your latest tested backup is.

05Approval

Who may take the site offline.

06Payments

The contact for your payment provider if you run a shop.

Keep it in a password manager or a printed sheet. A hacked site is a bad time to hunt for the email that holds your host's login.

A hypothetical walk-through

Imagine a small business owner who learns from a customer that the site redirects to a gambling page on phones. At minute five she opens the site on her phone, takes a screenshot and notes the time. At minute ten she asks the host to put a holding page up and opens a ticket. By minute twenty she has downloaded a copy of the files and database to an external drive, labelled "compromised", and saved the access log the host gave her. At minute thirty she changes the host, SFTP, database and admin passwords from her own laptop, logs out all sessions and rotates the keys. In the last quarter hour she lists the unknown administrator she found, checks Search Console for new messages, and contacts a specialist with the screenshots and the log. Nothing was deleted, and nothing was restored. That is the whole plan.

What to tell the person who cleans it

A clean-up starts faster when you hand over a short, factual summary. Include:

  1. When

    you first noticed it and how.

  2. What

    visitors see, and on which devices or from which sources.

  3. What changed

    recently: updates, new plugins, new users, hosting changes.

  4. What you have done,

    including every password changed.

  5. Whether

    you hold customer data on the site.

  6. The copy

    of the site you saved, and where it is.

Avoid speculation about who did it. The cause is nearly always automated and ordinary.

When is it not a hack?

Sometimes the problem is a misconfigured redirect, a cached page or a failed update. Before declaring an emergency, check from a second device, look at the Users list and read the host's notices. If nothing unusual appears, the safest assumption is still to change passwords, because the cost is small. Our guide on telling if your site is hacked goes through the checks in detail.

What comes after the first hour?

Cleaning, finding the cause and closing it, restoring from a known-clean state if needed, updating everything, and then watching for reinfection. Then ask your host and Google to review the site if it was flagged. If personal data was involved, take advice about notifying customers and authorities where the law requires it, which depends on where you and your customers are.

Afterwards, put the basics in place: tested backups, prompt updates, and monitoring, which is what our malware removal and care plan services add. If you need someone now, use emergency support.

Site hacked right now?

A person answers, any hour. Emergency Rescue is pay-only-if-fixed.

FAQ

Questions people ask

13 answers. Can't find yours? Ask an engineer.

Should I restore a backup straight away?

Not as the first move. A backup may contain the same weakness or the infection itself, and restoring can erase evidence. Preserve a copy first, then clean and close the entry point.

Link to this answer
Should I take the site offline?

If it is serving malware, redirecting visitors or sending spam, yes, put it in maintenance mode or block public access while you work. Tell the host if you cannot.

Link to this answer
Do I need to tell customers?

If customer data may have been exposed, there may be legal duties to notify. Take advice for your location, and do not guess.

Link to this answer
Should I restore a backup straight away?

Not as the first move. A backup may contain the same weakness or the infection itself, and restoring can erase evidence. Preserve a copy first, then clean and close the entry point.

Link to this answer
Should I take the site offline?

If it serves malware, redirects visitors or sends spam, yes: use maintenance mode, a holding page from your host or block public access while you work. Tell the host if you cannot.

Link to this answer
Why not delete the suspicious files immediately?

You would lose evidence of how the attacker got in and may miss other backdoors. Preserve first, then have everything found and removed properly.

Link to this answer
Which passwords should I change and from where?

WordPress administrators, hosting, SFTP, SSH, database, the admin email account and connected services such as CDN, DNS and payment dashboards. Do it from a computer you trust with current security software.

Link to this answer
What are WordPress secret keys and salts?

Values in wp-config.php that protect login cookies. Rotating them invalidates existing login cookies and logs everyone out. Back up the file first and do not paste keys anywhere public.

Link to this answer
Do I need to tell customers?

If customer data may have been exposed there may be legal duties to notify. Take advice for your location rather than guessing, and tell your payment provider early if you suspect card data exposure.

Link to this answer
What should I save as evidence?

A full copy of files and database labelled compromised and stored off the server, the access and error logs from your host and any security plugin logs, screenshots with times, and a note of recent updates and access changes.

Link to this answer
What should I hand to the person who cleans it?

When you noticed and how, what visitors see and on which devices, recent changes, what you have already done including passwords changed, whether you hold customer data and where the saved copy is.

Link to this answer
Is it always a hack?

Sometimes it is a misconfigured redirect, a cached page or a failed update. Check from a second device, look at the Users list and the host's notices. If nothing unusual appears, changing passwords is still the cheap safe step.

Link to this answer
Who can clean the site for me?

Malware clean-up has a 12-hour target and 30-day reinfection cover, and emergency support responds within 15 minutes on plans that include it. Emergency Rescue is pay-only-if-fixed.

Link to this answer

Keep reading

Want an engineer on it?

Tell us what is wrong in plain words. A person reads it, today.