Tutorials

WordPress Site Hacked? What to Do and When to Rebuild

BW

Bastian W.

Content Manager / ManyPI

5 min read
All posts
WordPress Site Hacked? What to Do and When to Rebuild

TL;DR

Asked in r/Wordpress: what to do when your WordPress site is hacked. Tell your host, change every password, restore a clean backup, then ask Google to review the site. Rebuild when there's no clean backup or the hack keeps coming back.

Rebuild it in ManyPI Sites

If your WordPress site has been hacked, work in this order: tell your hosting company, take the site offline, change every password, restore a clean backup, close the hole the attacker used, then ask Google to review the site so its warning comes off. If there's no clean backup, or the hack returns after every cleanup, rebuilding on a fresh platform is often quicker than another round of cleaning. Owners and developers talk through both routes in r/Wordpress and r/smallbusiness.

How do you know your WordPress site was hacked?

Most owners hear about it from someone else first. These are the usual signs, and where you'll see them:

Sign

Where you see it

"This site may be hacked" under your listing

Google search results

Visitors land on a site you don't know

Your own phone, logged out of WordPress

Pages you never wrote, often spam for pills or casinos

Search Google for site:yourdomain.com

Your host suspends the account or emails about malware

Your inbox

Admin users you didn't create

The Users screen in WordPress

A warning in the Security issues report

Google Search Console

What should you do in the first hour?

WordPress.org's own guide, Help I think I've been hacked, starts with your host, because on shared hosting the problem may reach beyond your site. Then:

  1. Tell your host. Ask whether they see the infection and what they're doing about it.

  2. Write down what you see and when it started. Screenshots help your host and anyone you hire.

  3. Take the site offline or into maintenance mode, so visitors stop being sent to the attacker's pages.

  4. Change every password: WordPress admins, hosting, SFTP, the database, and the email account that receives your reset links.

  5. Remove admin users you don't recognise.

How do you clean a hacked WordPress site?

Restore the newest backup from before the hack started, then update everything you can: WordPress itself, plugins, themes and the PHP version your host runs. Delete the plugins and themes you don't use. Check the backup's date against when the problems began. A backup that already contains the hack brings it straight back.

Without a clean backup, cleaning means comparing every file to fresh copies and searching the database for injected code. That's specialist work, and many hosts and security companies sell it as a service.

How do you get Google's "This site may be hacked" warning removed?

Google lists what it found in the Security issues report in Search Console. Fix all of it before you ask for a review. Google says fixing only some pages won't earn a partial return to search results.

Then click Request a review in the report and explain what you cleaned, such as the malicious code you removed and the plugin you updated. Google's guide to requesting a review says a review can take from a few days to a few weeks, and asking while the problem is still there only makes the wait longer. Once Google finds the site clean, it removes the warnings in browsers and search results within 72 hours.

Should you clean the site or rebuild it?

Clean it when you have a backup from before the hack and the site does things that are hard to rebuild, like a shop with orders and customer accounts. Rebuild it when there's no clean backup, when it's the second or third infection, when whoever built it is long gone, or when the site is really a few pages of text and photos held together by plugins nobody updates.

When to clean a hacked WordPress site and when to rebuild it.

When to clean a hacked WordPress site and when to rebuild it.

A rebuild also settles the question that caused the hack in the first place. If nobody was updating plugins before, nobody will afterwards either.

How do you rebuild a hacked site without bringing the hack along?

Keep the content and leave the code behind. The text, photos, logo, contact details and opening hours are worth keeping. The theme, the plugins, the database and any file the attacker added are where the hack lives.

  • Copy text only from pages you've checked, or from your clean backup. Injected spam links look like ordinary text once they're on a page.

  • Keep the same page addresses where you can, and redirect the ones that change, so links and rankings carry over.

  • Let the spam pages die. Pages the attacker created should return "not found" on the new site, so Google drops them.

  • Keep the business details identical to your Google listing. Our local SEO checklist for a new website covers the rest of what to check before launch.

Doing it with ManyPI Sites

Disclosure: ManyPI is our product.

ManyPI Sites can rebuild a site from its address. Paste the domain, and the Agent reads up to 40 pages, takes a desktop and a phone screenshot, and copies the logo, photos, contact details and opening hours into a new site you finish on a design canvas. Paste the domain only once the live pages are clean, because anything the attacker injected into the text would be read in too. If the site is offline, describe the business in a sentence or start from a template, then paste in the text from your clean backup.

The template browser in ManyPI Sites, with a pest control template's pages ready to tick and add. Sample content.

The template browser in ManyPI Sites, with a pest control template's pages ready to tick and add. Sample content.

The site is built and hosted in ManyPI, so there's no plugin or theme for you to keep patched. Up to 200 redirects keep old page addresses working, and the sitemap lists every page once your domain points at the new site. Building and previewing is free. Going live needs a site plan, from $15 a month for Basic, and a live site on a site plan shows no ManyPI badge.

If you build sites for clients, a hacked site is a client with an urgent reason to say yes. Our guide on what to charge for a small business website helps you quote it.

Before anything else today, change the password of the email account your WordPress admin uses. If that inbox is compromised, every reset link goes to the attacker.

Where to read more on Reddit

Subreddit

What it's about

What to search there

r/Wordpress

WordPress users and developers

WordPress site hacked what to do, malware redirect cleanup

r/smallbusiness

Owners running their own businesses

website hacked fix or rebuild, cost to clean hacked site

Written by

BW

Bastian W.

Content Manager / ManyPI

We already know your next customer