Skip to content
If your website were hacked tonight, who would notice first: you or your customers? New: website maintenance and CyberEX security from € 50 per month. Learn moreIf your website were hacked tonight, who would notice first: you or your customers? New: website maintenance and CyberEX security from € 50 per month. Learn moreIf your website were hacked tonight, who would notice first: you or your customers? New: website maintenance and CyberEX security from € 50 per month. Learn more
← All articles

Hacked WordPress website: what to do in the first hour

Hacked WordPress website: what to do in the first hour

In short

  • Don't delete files or restore a backup until it's clear how the attacker got in.
  • Change your passwords from another computer or phone: WordPress, hosting, database, FTP and SSH.
  • Ask your hosting provider to keep the server logs. Without them, the entry point often can't be determined.
  • In one of our cases, attackers were on the site for 66 days before anyone noticed, so recent backups were no use.

If your WordPress website has been hacked, don’t delete anything in the first hour. Take screenshots of what you see, stop the damage to visitors and change your passwords from another device. Below are 8 steps in the order you should do them, and the mistakes that make things worse. Once the site is clean again, a free security audit will show which weak spots are left, and WordPress maintenance with CyberEX security from €50 a month helps you spot the next attempt in time.

This article is written for website owners without technical knowledge.

How to tell your website has been hacked

Sometimes it’s obvious, and sometimes a customer is the first to tell you. The most common signs:

  • your homepage shows foreign content, such as a casino page;
  • visitors coming from Google or a phone are redirected to another site;
  • the browser or Google shows a red warning about a dangerous site;
  • WordPress users include administrators you didn’t create;
  • the plugin list contains plugins you didn’t install;
  • your emails land in spam because someone is sending junk mail from your domain;
  • your host sends a message about suspicious files or high server load.

If your site is connected to Google Search Console, open the security issues report: there Google shows exactly what it found on your site. Even a single sign is reason enough to act. Attackers often dig in quietly first and cause visible damage later.

What to do in the first hour: 8 steps

Each step has a note on why it matters, because under stress it is the most important things that get skipped.

StepWhat to doWhy
1. Write down what you seeTake screenshots, note the addresses of pages with foreign content and the time you noticed it.An hour later the picture may be different, and this information helps find where the hack started.
2. Don’t delete anythingNo files, no plugins, no users.These are traces. If you delete them, you often can no longer find out how the attacker got in, and the hole stays open.
3. Stop the damage to visitorsIf the page redirects people to other sites or shows foreign content, turn on maintenance mode or ask your hosting to take the site offline for a while.With every visitor who sees it, you lose trust, and Google quickly blacklists such sites.
4. Save a copy of the site as it is nowDownload the files and database from the hosting panel or ask hosting support for them.It is both evidence and a safety net if something goes wrong during cleanup.
5. Change passwords from another deviceWordPress admin, hosting panel, database, FTP and SSH, and the email that receives password reset links.If your computer has malware that records keystrokes, the new passwords will reach the attacker too.
6. End sessions and review administratorsEnd all user sessions in WordPress and note any accounts you don’t recognise. Turn on two-factor authentication for trusted administrators.Changing a password alone does not kick out an attacker who is already logged in.
7. Notify your hosting and ask them to keep the logsAsk how long they keep access logs and ask them not to delete them.In the case we described, the logs were kept for only 7 days, and the entry point could no longer be confirmed with full certainty.
8. Decide who will clean the siteIf you have a developer or maintainer, call them now. If not, look for a specialist.
Eight steps for the first hour after you notice a hack.

What not to do

  • Don’t restore a backup blindly. If the attacker has been on your site for weeks, the backdoor is in the backups too. Restoring one hands the attacker access back and loses whatever changed on the site in the meantime.
  • Don’t delete logs or “suspicious” files. They are the only way to find out what happened.
  • Don’t install five security plugins at once. They get in each other’s way, slow the site down and create a false sense that the problem is solved. Automated scanners often miss disguised backdoors.
  • Don’t change passwords from the computer you use every day to log in to the site until you’re sure it’s clean.
  • Don’t request a Google review before the site is clean. If the warning is removed and the infection returns, the warning appears again.

Why restoring a backup often isn’t enough

One company’s homepage was suddenly replaced by a casino. It looked like a one-day attack. The investigation showed the attackers had got in 66 days earlier, most likely through an outdated WordPress version, and had spent all that time quietly preparing.

We found 90+ artifacts on the site: 22 fake administrator accounts, four hidden backdoor plugins, more than 15 disguised index.php files deep in the WordPress folders, and a directive that ran the attacker’s code before every page request. Had you deleted only the visible casino page or only the unfamiliar plugins, the other entry points would have kept working.

Backups didn’t help: the latest clean one was more than 66 days old. Manual cleanup took 6 hours over three passes, and afterwards we also replaced keys, passwords and server settings. We described the whole process with technical details in the article How we cleaned a WordPress site of 90+ malware artifacts in 6 hours.

That’s why you first need to find every entry point and only then start cleaning.

When to call in a specialist

You can handle it yourself if you know when and how the site was hacked, you have a backup that is definitely older than the breach, and nothing important has changed since. Call a specialist if:

  • you don’t know when the breach started;
  • the site has orders, customer accounts or forms with personal data;
  • the foreign content comes back after you clean it yourself;
  • Google already shows a warning and every day costs you visitors.

Choose a specialist who also finds out how the attacker got in, otherwise the hole stays open. The amount of work depends on how deep the attacker got: one infected plugin and a site with a two-month-old backdoor are very different jobs. Once the site is clean, you can move it to maintenance with CyberEX security so the next attempt is spotted in time.

How to prevent it from happening again

Four things we learned from that case:

  • Updates within weeks, not months. Once a vulnerability goes public, automated scanners start exploiting it very quickly, sometimes the same day.
  • Backup history of at least 90 days, stored off the server. If an attacker hides for 66 days, a shorter history won’t help.
  • Logs for at least 180 days if the site processes personal data.
  • A firewall (WAF) and two-factor authentication for all administrators.

If you can’t keep an eye on it yourself, leave it to a maintainer. Our WordPress maintenance with CyberEX security costs from €50 a month with no setup fee: we install the updates, and the site is monitored 24/7, even if it is on another hosting. How often scanners knock on an ordinary website is shown in the article 616 attack attempts in 8 days. If you want to know what weak spots your site has right now, request a free security audit.

Frequently asked questions about a hacked website

Should a hacked website be taken offline?

If it redirects visitors to other sites, shows foreign content or spreads malware, yes: turn on maintenance mode or ask your hosting provider to suspend it for a while. Don’t delete the files or the database. If the breach is only visible in the admin area, changing passwords and ending sessions is enough until a specialist checks the site.

Is restoring a backup enough?

Only if you know the backup is older than the breach and contains all the content you need. In the case described, the clean backup was more than 66 days old. A backup also doesn’t close the hole the attacker came through, so after restoring you need to install updates and change passwords right away.

How long does it take to clean a hacked website?

It depends on how deep the attacker got. In our case, with 90+ artifacts, the cleanup took 6 hours, and afterwards we hardened the configuration. A simpler case means less work, but you can only tell after an inspection.

Do I have to report it to the data protection authority?

If the attacker could access personal data, such as orders, customer accounts or form submissions, the GDPR requires you to report the breach to the supervisory authority within 72 hours of becoming aware of it. In Latvia, that is the Data State Inspectorate. You can also report the incident to CERT.LV voluntarily.

How do I remove the Google warning about a dangerous site?

First, the site has to be completely clean. Then request a review in the Security Issues report in Google Search Console and describe what was fixed. The decision and its timing are up to Google. If you request a review too early and the infection comes back, the warning appears again.

Will my hosting provider help clean the site?

A host can usually suspend the site, keep the logs and restore its own backup. That is useful, so contact them right away. Finding out how the attacker got in and removing disguised backdoors from WordPress is a different job, and it is usually not part of the hosting service. Ask your host exactly what they do.

If your website has been hacked

If the hacked website is yours, follow the eight steps and don’t delete anything. If you want to report the incident voluntarily, you can do so through the CERT.LV incident report, and information about personal data breaches is on the Data State Inspectorate website. Once the site is clean again, request a free security audit and find out which weak spots are still left. To hear about the next attempt from us rather than from a customer, take a look at CyberEX maintenance from €50 a month.

Request a free security audit

Ready to start your project?

Write a few sentences about your business. We reply within 2 hours, every day from 9:00 to 23:00 (Riga time).

Or call +371 28 706 247 or message us on WhatsApp.