Web Development

WordPress Site Hacked? What to Do in the First Hour (and How to Stop It Happening Again)

Web Brick Studio · · 4 min read

WordPress Site Hacked? What to Do in the First Hour (and How to Stop It Happening Again)

If your WordPress site is hacked: don’t delete anything yet, change your hosting and WordPress admin passwords, take a backup of the hacked site for evidence, then clean or restore from a clean backup taken before the hack. After that, update everything, remove unknown admin users and plugins, and ask Google to review the site if it shows a warning. Most hacks come in through an outdated plugin or theme.

Finding out your site redirects to a casino page, or that Google now shows “This site may be hacked”, is a horrible feeling. Breathe. It’s fixable, usually the same day.

Signs your WordPress site has been hacked

  • Visitors get redirected to spam sites, often only on mobile or only from Google
  • Google results show Japanese or pharmacy spam under your domain
  • New admin users you didn’t create
  • Your host suspends the account for malware or spam emails
  • Chrome or Google Search shows a security warning
  • Unknown files in wp-content/uploads ending in .php

The first hour

  1. Change passwords. Hosting control panel, WordPress admins, FTP/SFTP, database. Use a password manager and new, unique passwords.
  2. Back up the hacked site. Yes, the infected one. It helps you find how they got in, and you have something to roll back to if the clean-up breaks things.
  3. Tell your host. Many hosts, Hostinger included, have malware scanners and support teams who’ve seen this before.
  4. Put up a maintenance page if the site is sending visitors to harmful pages.

Cleaning it up

Option A: restore a clean backup

If you have a backup from before the hack, restore it, then immediately update WordPress, themes and plugins. The hole that let them in is probably still there in that old backup, so updating straight away matters.

Option B: clean the current site

  1. Replace WordPress core files with fresh ones from WordPress.org (keep wp-config.php and wp-content).
  2. Delete and reinstall every plugin and theme from official sources. Delete any you don’t use.
  3. Search wp-content/uploads for PHP files. There shouldn’t be any.
  4. Check wp-config.php and .htaccess for code you don’t recognise.
  5. Under Users, remove unknown administrators.
  6. Scan with a security plugin like Wordfence or your host’s scanner.
  7. Change the security keys (salts) in wp-config.php. This logs everyone out.

Nulled (pirated) premium plugins are a common source of hidden backdoors. If you have any, delete them. No exceptions.

Fix the damage in Google

In Search Console, check Security & Manual Actions > Security issues. Once the site is clean, click “Request review” and explain what you fixed. Spam pages created by the hack should return 404 or 410 so Google drops them. Use the Removals tool for urgent cases.

How to stop it happening again

  • Update plugins, themes and core every week, after a backup
  • Remove plugins you don’t use
  • Use strong passwords and two-factor login for every admin
  • Keep automatic daily backups stored off the server
  • Run a supported PHP version
  • Give users the lowest role they need. Editors don’t need admin.

Honestly, most of this is “do the updates”. It’s dull. It works. Our website maintenance guide explains what a proper plan covers.

Sources

Need your hacked site cleaned today? Our WordPress team cleans, secures and maintains WordPress sites. Get in touch.

Frequently asked questions

How do I know how my WordPress site was hacked?

Check your hosting access logs around the date the problem started, look at recently modified files and see which plugins had known vulnerabilities at the time. An outdated plugin or theme, a weak password or a nulled plugin is the cause in most cases.

Will Google remove the “site may be hacked” warning?

Yes, once the site is clean. Request a review in Search Console under Security issues. For hacked spam warnings in search results, the label disappears after Google recrawls and confirms the spam pages are gone.

Can I clean a hacked WordPress site myself?

If you’re comfortable with file managers, FTP and databases, yes. Follow the clean-up steps carefully and replace every plugin and theme. If the hack keeps coming back, a backdoor is still hiding, and professional help is worth it.

Do security plugins prevent hacks?

They help with firewalls, login protection and scanning, but they don’t replace updates. Most hacks exploit known holes in outdated plugins, and a security plugin can’t fully protect software you never update.

Keep reading

More from our blog.