Skip to content
Free website migration on every plan, done by our team.Learn more ›
Security

Website hacked? What to do in the first hour

A calm plan for a hacked website: contain it, change every password, restore a clean backup, update everything, find the cause and recover rankings.

Short answer: Don't panic and don't delete everything. Contain the damage, change every password, restore the most recent clean backup, update all software, find and fix the entry point, then ask search engines to re-check the site. Your host can help with most of it, and many sites are back to normal within a day.

Discovering that your website has been hacked is alarming, but it is very common and very fixable. What matters is acting calmly and in the right order, so you don't destroy evidence, lose content or get hacked again next week.

Signs your site has been hacked

  • Strange redirects to gambling, pharmacy or adult sites, especially for visitors coming from Google or on mobile.
  • Pop-ups, adverts or links you didn't add.
  • Google or your browser warning that the site is dangerous or "may be hacked".
  • Spam pages in Google results for your domain. Search site:yourdomain.com and look for pages in other languages or about unrelated products.
  • New admin users, files or scheduled tasks you don't recognise.
  • Your host reporting malware or high outgoing email volume.
  • Customers telling you they received strange emails from you.

The first hour

  1. Contain it. Put the site in maintenance mode if visitors are being redirected or harmed. See WordPress maintenance mode.
  2. Change every password, starting with the most powerful: domain registrar, hosting client area, cPanel, FTP or SFTP, database, CMS admins and email. Use a different computer if you suspect yours is infected. Turn on two-factor authentication.
  3. Contact your host. At AuroxHost, message us on WhatsApp 24/7; we can check server logs, scan the account and help isolate the problem.
  4. Take a copy of the hacked site for investigation before you clean it. It shows how the attackers got in.
  5. Note the time you first noticed the problem, so you can choose a backup from before it.

Clean up

  1. Restore a clean backup from before the problem started. Your host's daily backups or your own copies work. See WordPress backups and cPanel backup and restore.
  2. Update everything: core, plugins, themes and PHP. See which PHP version.
  3. Remove what you don't use, especially old plugins and themes, and any "nulled" or pirated software.
  4. Scan again with a malware scanner. See scanning a website for malware.
  5. Check user accounts and remove unknown ones. Check for unfamiliar cron jobs and email forwarders too.
  6. Change the passwords again once the site is clean, including database passwords and WordPress security keys.

If you have no clean backup, a professional clean-up is safer than deleting files by hand: malware often hides in several places, including the database.

Find the cause

Common entry points:

Entry pointPrevention
An outdated plugin or theme with a known holeUpdate promptly; remove unused code
Pirated "nulled" themes or pluginsOnly install from official sources
Weak or reused passwordsA password manager and 2FA
An infected computer that saved login detailsAntivirus and never saving FTP passwords in plain text
An old staff, freelancer or agency accountRemove access when people leave
Insecure file permissionsSee file permissions on Linux

Fix the cause or it will happen again. Our website security basics and WordPress security checklist cover prevention.

Recover trust and rankings

  1. Request a review in Google Search Console under Security issues once the site is clean. Reviews usually take from a day to a few days.
  2. Remove spam pages the hack created and let them return a 404 or 410. See fixing 404 errors.
  3. Check your email reputation if your server sent spam. See email blacklist checks.
  4. Tell customers if their personal data may have been exposed. Data protection laws, including Nigeria's NDPA, may require you to notify affected people and the regulator. See responding to a data breach.

Frequently asked questions

Should I delete my whole site and start again?

Usually not. Restoring a clean backup and fixing the entry point is faster and keeps your content.

Can I just remove the bad files?

Malware often hides in several places, including the database and image folders. A full restore or a thorough professional clean is safer.

How do I know if my site is still infected?

Rescan it, check Search Console for security issues, search site:yourdomain.com for spam pages and watch for unexpected redirects on mobile.

How do I prevent it next time?

Follow website security basics and the 3-2-1 backup rule, and add a web application firewall.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.