Blog

Website hacked? A practical recovery plan for your business

Website hacked? A practical recovery plan for your business

What to do after a website hack: contain the damage, preserve evidence, restore safely and address Google security warnings.

A customer sends a screenshot: your website has redirected them to a gambling page. You open the same address and everything looks normal. That does not settle the question. Malicious changes can depend on the visitor, device or entry point.

Start a short incident record: what happened, which address was involved, when it happened and who noticed it. Then work through containment, investigation and recovery. Trying random fixes makes it harder to tell what changed and whether the attacker still has access.

First, stop the damage without losing the evidence

If the site is distributing malware, collecting credentials or redirecting visitors, ask your hosting provider to restrict access while you investigate. A maintenance page served independently of the compromised application may be appropriate. Keep a way for customers to contact you.

Preserve a copy of the current files, database and available logs before cleanup, where this can be done safely. Label it as an incident copy and keep it separate from backups intended for restoration. It may contain malicious code and personal data; do not leave it publicly downloadable.

Ask the host to preserve access and error logs, account-login history and any malware findings. Note the time zone. Logs may rotate before you finish investigating.

  1. Assign one person to coordinate changes and record decisions.
  2. Contact the hosting provider and explain the visible symptoms.
  3. Restrict harmful public functionality and preserve evidence.
  4. Secure the accounts that control the hosting, domain and website.

Use a trusted device when recovering access. Review recovery email addresses, unfamiliar users and active sessions. Revoke access you cannot account for. Rotate exposed passwords and keys promptly, then rotate any recovery credentials that may have been visible during cleanup. Enable multifactor authentication where available.

Establish what was actually compromised

A broken page can come from a failed deployment. An unfamiliar administrator or injected payment script needs a different response. Record observations before drawing conclusions.

ObservationWhat to investigate
Unexpected redirectsApplication code, database content, server rules and third-party scripts
New administrator accountsUser history, permission changes and account sessions
Spam pages under your domainFiles, generated routes, database entries and sitemap changes
Unexpected checkout behaviourPayment-page scripts, integrations and recent deployments
Hosting suspensionThe provider's incident report, affected paths and restrictions

Check more than the homepage. Include login pages, uploads, scheduled tasks and the places where users submit data. On a shared hosting account, investigate neighbouring sites too. A clean scan is useful evidence, but it does not establish how access was gained.

Choose a recovery route you can verify

Restore a known-good backup

Check when the backup was made and whether it predates the compromise. A recently created backup can contain the same malicious changes as production. Test restoration in an isolated environment, inspect the restored site and close the entry point before reopening it.

For a shop, compare orders and customer changes made since that backup. Restoring an old database can remove legitimate transactions. Agree how those records will be reconciled before replacing production data.

Rebuild the application environment

If you cannot trust the installed files, redeploy from reviewed source and trusted installation packages. Review configuration, uploaded files and database content separately. Rebuilding a container from a compromised source tree simply packages the problem again.

For WordPress, the project maintains a hacked-site recovery guide. Its checks are a useful starting point; the work still needs to match the affected installation.

Backup drives and an incident checklist prepared for website recovery
Keep evidence, restoration backups and the working recovery environment separate.

Close the route back in

Document what allowed the compromise and what changed. Review the runtime, CMS, extensions and deployment process, as well as account access. Remove unused components and privileges. Check that the fixed version is actually running across every instance.

A web application firewall can reduce some exposure while you work, but it does not remove a backdoor from the server. Cloudflare's recovery guidance covers coordinating with the host and reducing the risk of another incident.

If your assessment identifies a relevant runtime issue, see our PHP2Shell protection and Node2Shell audit and remediation offers. A vulnerability name alone is not a diagnosis of your incident.

Reopen the site against a written checklist

Test navigation, sign-in, forms, downloads and the agreed checkout flow. Check unexpected redirects and outgoing connections, confirm backups work, and make sure temporary investigation tools are removed. Paid test transactions need a separately agreed procedure.

Keep monitoring after reopening. Record unexpected account changes, new files, application errors and reports from customers. Repeated infection means the recovery needs another investigation, not another round of deleting the same visible files.

Deal with Google warnings after the cleanup

Use Search Console's Security issues report to review findings. Example URLs are only samples. Fix all reported issues across the site, test the result, then request a review and explain what you changed.

Remove attacker-created pages and use an appropriate 404 or 410 response for URLs that should no longer exist. Check that the sitemap contains legitimate pages. A security review is different from requesting indexing. Neither guarantees a date for warnings to disappear or rankings to recover.

If customer data may have been exposed

Bring the person responsible for data protection into the investigation early. Establish which data was affected, whether it was accessed or altered, and what risks people face. Preserve the evidence behind that assessment.

Under GDPR, a controller must notify the supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware of a personal data breach, unless it is unlikely to result in a risk to people's rights and freedoms. High risk can also require informing affected people without undue delay. Record the assessment even where notification is not required. In Poland, consult the UODO breach guidance and your data protection adviser; do not wait for technical cleanup to finish before assessing your obligations.

What improveIT can help with

We can agree a scope for investigating the website, preserving available evidence, restoring service and verifying the changes. If the application needs a larger migration or rebuild, we discuss that separately. Cost and timing depend on access, architecture and what the investigation finds.

Sources and documentation