Hosting & Infrastructure

Website Hacked? What to Do in the First 24 Hours

Website hacked? Stay calm. Signs, the first 24 hours step by step, cleanup, search engine warnings and the safeguards to put in place afterwards.

rabbitclip teamPublished: 7 min read

Short answer

If you suspect your website has been hacked, stay calm and keep to a sequence: take the site off public view if you have to, keep a copy of its present state and the logs without deleting anything, change your hosting, admin panel, database and email passwords from a clean device, tell your hosting company, and only then restore from a clean backup or have an expert clean it. Deleting everything in a hurry wipes out the traces that show how the attacker got in, and it invites the same break-in again through the same gap.

A hack does not always look like a defaced home page. Often it is quiet: hidden links are added, visitors are redirected to another address, or the server is used to send spam. Knowing the signs is half of the first step.

Below you will find the signs, what to do in the first 24 hours in order, how cleanup proceeds, how to deal with a search engine warning, and which safeguards you need afterwards.

How do I know my website has been hacked?

The obvious sign is a changed page or a ransom message. Quiet signs are more common, though. If your title appears in search results with foreign content you did not write, if visitors on their phones are thrown to another site, or if the browser says the site may be harmful, the situation is serious.

There are other signs too: an unknown user in the admin panel, a plugin you never installed, a resource warning or spam notice from your host, customers telling you they received emails you did not send. One sign is not proof, but if several appear together, assume the worst and act with care.

  • Titles or descriptions in search results that you did not write
  • Visitors being redirected to another site
  • A harmful-site warning from the browser or the search engine
  • An unknown user or plugin in the admin panel
  • The server slowing unexpectedly, or a warning from your host

What do you do in the first 24 hours, and in what order?

The aim is first to stop the damage, then to protect the evidence, then to regain control. Putting the site behind a maintenance page stops visitors being exposed to malicious code. Then, without changing anything, copy the present state of the files and the database to a separate place, and keep the server access logs too. Finding out how the attacker came in depends on those logs.

Next, change the passwords, but from a clean device. The attack may have started from your own computer, so scan that as well. Choose unguessable values, a different one for every account; the password generator on our site can help with that. Finally, write to your hosting company; they can check whether other accounts on the server were affected.

  • Put the site behind a temporary maintenance page
  • Keep a copy of the files, the database and the access logs as they are
  • Change hosting, admin panel, database, FTP and email passwords from a clean device
  • Note any unknown administrator users and plugins, and disable them
  • Tell your hosting company
  • Scan your own computer for malware

Is restoring a backup enough, and how is cleanup done?

A backup helps only if it predates the hack. If malicious code settled in months ago, the backup itself is infected, so before restoring you must know which backup is clean. Restoring alone is not enough either: if the gap the attacker used stays open, they will come back the same way.

Proper cleanup goes in this order: content is moved onto a clean backup or a fresh installation of the software, the software, theme and plugins are updated, unused ones are removed, admin accounts are reviewed, and only then do you reopen the site. If you are unsure at any point, it is safer to inspect a copy elsewhere first and then take it live.

How is a search engine or browser warning removed?

After the site is cleaned, the warning may not disappear by itself. The webmaster tools of search engines tell you when a security problem has been detected, and once it is fixed you need to request a new review. The request is made with a short explanation of what the problem was and how you fixed it. Review times vary, so no timescale can be promised.

Meanwhile, clean up any foreign pages left in search results: addresses you did not create should be gone, and the sitemap should be clean. Once the malicious pages are removed, it takes time for them to stop appearing in search.

Read this nextHow to Choose a Business Email Service: Key Criteria

What mistakes are made most often in a panic?

The first is deleting everything without taking a copy, which loses the attacker's trail. The second is fixing only the home page and leaving the back door, so the attacker returns a week later. The third is changing passwords from the same computer that may itself be compromised.

The fourth is hiding the incident. If customer data may have been affected, a duty to notify may arise; that is a legal matter and you should ask a lawyer. On a site that holds personal data, factor this in from the first day.

  • Deleting before copying
  • Fixing the visible symptom without closing the gap
  • Changing passwords from a possibly compromised device
  • Not weighing the possibility of customer data exposure with a lawyer

When is cleaning it up myself the wrong choice?

On a small site with a single installation and a clean backup, the job is often manageable. But on a site with customer data, a payment flow or a membership system, or if you cannot find where the malicious code is, handling it alone is a risky choice. A poor cleanup leaves remnants and the same incident happens again.

In those cases turn to your hosting company's security support or the team that built the site. Finding the route the attacker used is as much part of the job as the cleaning. Any repair made before that is found is only temporary.

What safeguards stop it happening again?

The safeguards are dull but effective. Keep software, themes and plugins up to date and delete the ones you do not use. Use strong, unique passwords and two-step verification on admin accounts, and give each person only the access they need. Keep backups off the server, in a separate place, and keep them regular.

It also helps to check the site from outside now and then with scans. Security headers and a firewall layer narrow the attack surface. None brings zero risk; the aim is to make an attack harder and to recover quickly when one happens.

  • Regular updates and removal of unused plugins
  • Strong, unique passwords and two-step verification
  • Least privilege: everyone gets only the access they need
  • Regular, tested backups kept off the server
  • A firewall and security headers

The rule for the first 24 hours after a hack is simple: stop it, keep it, change the passwords, report it, return from a clean copy and close the gap. A rushed cleanup leaves the gap open. The next step is to set up regular updates and an off-server backup routine. If you would like us to look at your site's security together, we would be glad to hear from you in a discovery call with rabbitclip.

FAQ

Should I take my site offline straight away if it is hacked?

If visitors are being exposed to malicious code or redirects, a temporary maintenance page is reasonable. But do not delete files before you have taken a copy.

Will my hosting company clean the site for me?

That depends on the company and your plan. Some offer support or a paid service, others only look at the server side. Ask in writing what they will and will not do.

I cleaned the site but the warning is still in search results. What now?

Report in the search engine's site tools that the security problem is fixed and request a new review. No exact removal time can be promised.

What if customer details were stolen?

There may be a duty to notify about personal data; that is a legal matter, so consult a lawyer straight away. It is also reasonable to advise affected users to change their passwords.

If I have a backup, is the hack dealt with?

No. A backup only brings the content back. If the gap the attacker used stays open, the site can be taken over again, so updates and password changes are needed too.

Share

Related serviceCloud & InfrastructureWe’ve seen infrastructure that strains as it grows and falls over under load; that’s why we build it solid from the start. Security and uptime are designed in early, and the technical weight sits with us.

Related free tools

Terms in the glossary

Related articles

More on this topic

If you don’t know where to start, that’s fine; you’re in the right place.

Your project might already be clear in your head, or still just an idea. Either works. On a short call we talk through where you are and where you could go, together.

Let’s set up a call
Let’s talk about your project