2005since
year

Hosting & Security

Has Your Website Been Hacked? A Step-by-Step Response and Recovery Plan, and How to Stop It Happening Again

A strange page on your site, redirects to suspicious sites, a red warning from Google, or spam sent in your name. We explain the signs of a hack, the first steps in the first hours, how to clean and restore the site, request a Google review, and prevent the hack from happening again.

  • 16 Nov 2026published
  • 7min read
  • Nov 2026updated
Key takeaways
  • Don’t rush to delete; save a copy of the current state for analysis before cleaning.
  • Change every password and key after cleaning, not only before.
  • Restoring a clean backup is often faster, but you must close the hole the attacker came through.
  • If a Google warning appears, clean up and then request a review through Search Console.
  • Most WordPress hacks come from outdated plugins or themes, or weak passwords.

A message from a client: “Your website is redirecting me to a strange site!”. You open the site from your office and it looks completely normal. You try it on your phone via a Google search, and it redirects you to a suspicious page. This is a common technique: the attacker hides the hack from the site owner (who visits directly or while logged in) and shows it to visitors arriving from search or on mobile. A few days later your visitors may see a big red browser warning: “The site ahead may be dangerous.”

A hack is a worrying experience, but a calm, organised response limits the damage a great deal. In this guide we explain the steps we follow when responding to a hacked site within our hosting and maintenance service.

Signs of a hack

SignWhat it may mean
Visitors redirected to other sitesMalicious code in the files, the database or the server settings
Strange pages or links in Google (drugs, gambling, counterfeit goods)Injected spam pages exploiting your domain’s reputation
A browser or Google warningMalware or phishing detected
Administrator users you don’t recogniseThe attacker has created a back door
Strange PHP files in the uploads folderBack doors
Spam email sent from your serverThe server being used to send
Sudden slowness and high resource useThe server being used for mining or attacks
A changed home pageOpen defacement

The first hours: what to do immediately

  1. Don’t panic, and don’t delete anything yet. Hasty deletion removes the evidence of how the attacker got in.
  2. Save a copy of the current state (files, database and server logs) somewhere separate, for analysis.
  3. Contain the damage: enable maintenance mode if the site is harming visitors with redirects or malware.
  4. Change the critical passwords immediately — the hosting control panel, the domain and the email linked to them — from a clean device.
  5. Inform the hosting provider: it may have logs and scanning tools, and the hack may be at server level.
  6. Determine whether personal data was exposed: client data, orders, accounts. This decides your notification obligations.
  7. Pause ads pointing to the site until it’s clean.

Analysis: how did the attacker get in?

Cleaning up without knowing the vulnerability usually means a new hack within days. The most common sources on WordPress sites:

  • An outdated plugin or theme with a known vulnerability.
  • “Nulled” plugins or themes from unofficial sources that already contain back doors.
  • A weak or leaked password for an administrator or hosting account.
  • Another hacked site on the same hosting account.
  • File permissions more open than necessary.
  • An administrator’s device infected with malware that stole login details.

Server logs (access and errors), file modification dates and new users help identify the entry point and the timing.

Recovery: two main options

OptionWhen it fitsSteps
Restore a clean backupWhen there is a backup from before the hackEstablish the date of the hack, choose a copy from before it, restore it, update everything, close the vulnerability, and carry over legitimate content added after the copy
Manual cleaningWhen there is no clean copy, or the hack is very oldReplace WordPress core, plugins and themes with fresh official copies, inspect custom files and the uploads folder, clean the database, delete suspicious users and scheduled tasks

This is where a good backup strategy with multiple copies over long periods proves its value; the hack may have started weeks before it was discovered.

After cleaning: closing the doors

  1. Change every password again: site administrators, the database, hosting, the domain, email, FTP/SFTP.
  2. Regenerate the security keys in the WordPress configuration file to end all open sessions.
  3. Delete any unused user, plugin or theme.
  4. Update everything to the latest version, and replace any plugin that is no longer supported.
  5. Enable two-factor authentication for every administrator.
  6. Set file permissions correctly and block PHP execution in the uploads folder.
  7. Enable a web application firewall. Read CDN and protection.
  8. Check the devices of everyone with administrator access.

For the full list of preventive protection, read the WordPress security guide.

Google warnings and spam pages

If your site shows a security warning or spam pages in search results:

  • Open the “Security issues” report in Google Search Console to see what Google detected and samples of the affected pages.
  • After a complete clean-up, request a review from the same report, explaining what you did.
  • Delete the injected spam pages and make them return a 404 or 410 error; you can use the temporary removals tool to speed up their disappearance from results.
  • Check whether unknown new owners were added to your property in Search Console, and remove them.

Email after a hack

If your server was used to send spam, the reputation of its address and your email may be damaged. Stop the suspicious sending, review the mail logs, check blacklists and set up authentication. This is one more reason to separate business email from the website server. Read email authentication.

Notification and obligations

If the site collects personal data and a leak is possible, data protection laws may require you to notify the competent authority within a set period and to inform data subjects in certain cases. Document what happened and what you did, and consult a legal specialist. For organisations subject to the National Cybersecurity Authority’s controls, follow the approved incident-reporting procedures. Read data residency and protection.

Communicating during the crisis

Silence is the worst response when clients notice something is wrong. Prepare a short, calm message for clients who ask: “We’re aware of a technical issue with the website and are working to fix it; you can reach us by WhatsApp or phone until the site is back.” Don’t go into technical details or guesses before the analysis is complete. If it turns out data was affected, the follow-up message must be honest and clear: what happened, which data was affected, what the company has done, and what it advises clients to do (such as changing their password). Companies that handle incidents transparently usually keep their clients’ trust better than those that try to hide them and are later exposed.

Internally, appoint one person to handle communication with clients and the media if needed, and another to liaise with the provider and the technical team, so no conflicting messages go out. Keep a timeline of everything that happened and every action taken, with its time; it’s useful for analysis, for official reporting if required, and for the post-incident review. Record the names of the provider contacts and ticket numbers too; they save a lot of time in follow-up.

Lessons after the incident

Once things calm down, sit with the team and answer in writing: how did the attacker get in? When did the hack start, and when did we discover it? Why was discovery delayed? What worked in the response and what stumbled? What measures will prevent a repeat, who owns each one, and by when? This review isn’t about blaming anyone but about turning an unpleasant incident into a stronger system. Many companies come out of their first hack with real backups, monitoring and regular updates they never had before.

From our work: we work with companies that live security every day, such as Madarat Cybersecurity and Capital Systems surveillance and protection, and with contracting companies such as Ebdaa Al Hayat whose website is a trust storefront for clients. The common lesson: prevention through updates, backups and monitoring is far cheaper than recovery.

The bottom line

When hacked: preserve the evidence, contain the damage, change passwords, identify the vulnerability, restore a clean copy or clean carefully, close the doors, request a Google review, and meet notification obligations where needed. Most importantly, build a prevention system that makes a repeat less likely. We handle response, recovery and ongoing protection within hosting and maintenance. Get in touch right away if your site is hacked now.

FAQ

How do I know my site has been hacked?

Signs include: pages or links you didn’t add, visitors redirected to other sites (sometimes only on mobile or only from Google), a browser or Google warning, new administrator users, sudden slowness, or spam email from your server.

Should I delete the site and rebuild it?

Not necessarily. Restoring a clean backup, or careful cleaning while closing the vulnerability, is usually enough. Rebuilding makes sense if the site is very old and can’t be updated.

Must I inform my clients?

If personal data may have leaked, you may be required to notify the competent authority and the data subjects under personal data protection law. Consult a legal specialist.

How long does recovery take?

Restoring and cleaning can take hours to days depending on the site’s size and the depth of the hack, and removing a Google warning after requesting a review can take days.

Creative Agency
The Creative Agency team

Written from 20+ years designing websites and identities for clients in Saudi Arabia and Egypt — every tip here comes from real projects.

Want this applied to your project?

Book a free consultation — we will review your site or brand and propose a clear plan.

Book a free consultation

Get your free consultation now!