Websites · Security · WordPress

WordPress site hacked? Here's what to do first.

Finding out your website has been hacked is a horrible feeling. The good news is that most hacked WordPress sites can be cleaned up. The key is doing things in the right order, and not making it worse in the first hour.

The short version

  • Don't panic-delete. Call your host, change passwords and take a backup of the hacked site before you clean anything.
  • Clean or restore, then update everything and remove admin users you don't recognize, or it'll happen again.
  • If Google flagged your site, fix every page first, then request a review in Search Console.
  • Most hacks come in through outdated plugins and weak logins. Updates, backups and two-factor login prevent most of them.

If your WordPress site has been hacked, the first thing to know is that it's fixable. WordPress is very popular, which makes it a common target, and most hacks follow familiar patterns.

What to do, in order: don't delete anything yet, contact your host, change every password, take a backup of the hacked site, scan it, clean it or restore a clean backup, update everything, remove admin users you don't recognize, and request a review in Google Search Console if Google flagged you.

Below is each step in plain English, plus how to tell you've been hacked and how to stop it happening again.

Signs your WordPress site has been hacked

Some hacks are obvious. Others stay hidden for months because they're designed to. Watch for:

  • Google warnings. A warning next to your site in search results, or a full-page browser warning when people try to visit.
  • Strange pages in Google. Search site:yourdomain.ca and look for pages you didn't make, often in another language or selling things you don't sell.
  • Redirects. Visitors (often only on phones, or only from Google) get sent to a different website.
  • Admin users you don't recognize in your WordPress dashboard.
  • A message from your host saying your account is suspended or sending spam.
  • A Search Console email about security issues on your site.
  • A suddenly slow site or files changed on dates when nobody was working on it.

Step 1: Don't panic-delete

The natural reaction is to start deleting strange files or wipe the whole site. Don't. Deleting the wrong file can break the site, and wiping everything destroys the evidence of how they got in.

If you never find the way in, they can simply come back.

Step 2: Contact your host

Call or open a ticket with your hosting company. Tell them the site is hacked and ask what they can see.

Many hosts can scan your account, show recent file changes, and tell you if other sites on your account are affected. They may also have clean backups from before the hack.

If you don't know who your host is, or don't have the logins, that's a problem worth fixing for good. See who owns your website and domain.

Step 3: Change every password

Assume every login connected to the site is compromised. Change them all, from a computer you trust:

  • Every WordPress admin account
  • Your hosting control panel
  • FTP or SFTP accounts
  • The database password (your host can help, and the site's config file needs updating to match)
  • The email account tied to your WordPress admin and hosting

Use long, unique passwords, and turn on two-factor login wherever it's offered.

Step 4: Back up the hacked site

It sounds odd, but take a full backup of the site as it is now, files and database. If the cleanup goes wrong, you can get back to where you started. It also keeps a copy of what the hackers changed, which helps whoever is cleaning it find the way in.

Step 5: Scan the site

Use a reputable security scanner, your host's malware scan, or both. A scan will usually flag infected files, injected code and known bad plugins. It won't catch everything, so treat it as a starting point, not the final word.

Step 6: Clean it, or restore a clean backup

You have two choices:

  • Restore a backup from before the hack. This is often the fastest fix, if you know when the hack happened and have a backup from before then. You'll lose any changes made since.
  • Clean the site. Replace WordPress core files, themes and plugins with fresh copies, remove injected code and unknown files, and check the database for spam content and rogue users. This takes skill and time.

Either way, the restored or cleaned site still has the same weakness that let them in. That's why the next two steps matter.

Step 7: Update everything

Update WordPress, every plugin and your theme. Delete plugins and themes you're not using, rather than just turning them off. Outdated plugins are a common way in.

The Canadian Centre for Cyber Security's website security guidance says the same: keep a regular process for patching your content management system, web apps and plug-ins, and use multi-factor authentication on logins.

Step 8: Remove admin users you don't recognize

Hackers often create their own admin account so they can get back in later. Go to Users in your dashboard and check everyone with Administrator access. Remove anyone you don't recognize, and lower the access level for people who don't need full control.

Step 9: Request a review if Google flagged your site

If Google has put a warning on your site, open the Security Issues report in Google Search Console. Google's help on the Security Issues report says to fix the problem on every page first, because fixing only some pages won't get you a partial return. Then select Request Review and explain what was wrong, what you changed and the result.

Don't send a request while one is still pending. Google says reviews for malware take a few days, reviews for spam hacks can take several weeks, and warnings should clear within about 72 hours once a site is confirmed clean.

How to stop it happening again

Many WordPress hacks aren't personal. They're automated bots looking for known holes in old software and easy passwords. A few habits close most of those doors:

  • Keep everything updated. WordPress, plugins and theme, checked at least every week or two.
  • Keep backups off the server. Daily, automatic, and stored somewhere other than your hosting account. Test that they restore.
  • Turn on two-factor login for every admin.
  • Use fewer plugins. Every plugin is code someone else has to keep secure. If you don't need it, delete it.
  • Only give people the access they need. Most editors don't need to be administrators.
  • Pick good hosting. Cheap shared hosting with no security tools or backups is a false saving.

If that list sounds like a chore, it's exactly what our care plan is for. From $99/month it includes hosting, updates, backups and security, so someone is actually doing it every week. Our post on what website maintenance includes breaks down what that looks like.

When it's time to move

If your site keeps getting hacked, or your host can't help, moving to better hosting with a clean copy of the site is often the best fix. Done properly, a website migration keeps your content and Google rankings intact.

And once the mess is cleaned up, a hacked site is often a slow one, so speed optimization is worth a look too.

Want this off your plate for good?

Our care plan, from $99/month, covers hosting, updates, backups and security for your WordPress site. If you've been hacked, tell us what you're seeing and we'll tell you what we'd do first.
See website maintenance and hosting →

FAQ: hacked WordPress sites

How do I know if my WordPress site has been hacked?

Common signs are a Google warning in search results or the browser, pages in Google you didn't create, visitors being redirected to other sites, admin users you don't recognize, a warning from your host, or a security email from Google Search Console.

Should I delete my hacked WordPress site and start over?

Not right away. Deleting everything destroys the clues about how the hackers got in, and you may lose content you need. Take a backup of the hacked site first, then clean it or restore a backup from before the hack, and fix the weakness that let them in.

How long does it take Google to remove a hacked site warning?

After you fix every page and request a review in Search Console, Google says malware reviews take a few days and spam hack reviews can take several weeks. Once the site is confirmed clean, warnings should clear within about 72 hours.

Can my web host fix a hacked WordPress site?

Some hosts can scan your account, show recent file changes and restore backups. Many won't do a full cleanup, so ask what they include. It's always worth contacting your host first.

How do WordPress sites get hacked?

Most often through outdated plugins or themes with known security holes, and through weak or reused passwords. Automated bots look for these, so even a small business site can be hit.

How do I protect my WordPress site from being hacked?

Keep WordPress, plugins and your theme updated, keep automatic backups stored off the server, turn on two-factor login, delete plugins you don't use, limit admin access and use decent hosting. A care plan can handle all of this for you.

Site hacked? We can help.

Tell us what you're seeing and who hosts your site. We'll tell you what we'd do first, and how we'd keep it from happening again.

Email us Call 416-892-7774 Text us

Not sure where to start? Try the free website audit.