Call Us Now 0333 444 0283
Digital Flair home
Established 2003 Websites, software and connected business systems Discuss your project →

How to Fix a Hacked WordPress Website: A Step-by-Step Guide

Finding out your WordPress website has been hacked is stressful, but it is usually fixable. This guide explains how to tell whether your site has been hacked, what to do straight away and how to clean it up properly, so the same thing does not happen again next week.

Signs your website has been hacked

Hacks are not always obvious. Many are designed to stay hidden from the site owner while they target visitors or search engines. Look out for:

  • Visitors being redirected to other websites, often only on phones or when they arrive from Google
  • Strange pages in Google results, such as foreign-language or spam product pages under your address
  • A “Dangerous site” or “Deceptive site ahead” warning in Chrome or other browsers
  • Admin users you do not recognise, or your own login no longer working
  • Your hosting account suspended, or your emails suddenly landing in spam
  • The site becoming unusually slow, or your server running at full capacity

If you see a warning in Google Search Console under Security issues, Google has already found the problem. It is worth checking there even if the site looks normal to you.

What to do straight away

  1. Do not panic, and do not delete everything Deleting files or restoring an old backup straight away can destroy the clues you need to find out how the attackers got in.
  2. Take a copy of the site as it is now Back up the files and database in their current state. This is your evidence, and a safety net if anything goes wrong during the clean-up.
  3. Change every password WordPress admin accounts, hosting control panel, SFTP or FTP, the database and any email accounts linked to the site. Use long, unique passwords.
  4. Contact your hosting company They may be able to see suspicious activity in the server logs, and some can help with containment.
  5. Protect your visitors If the site is redirecting people or serving malware, consider putting it into maintenance mode until it is clean.

How to clean the site properly

The order matters. A quick scan that removes the obvious malicious files often leaves a hidden way back in, and the site is reinfected within days.

  1. Find out how they got in The usual causes are an outdated plugin or theme, a “nulled” (pirated) premium plugin, a weak or reused password, or another site on the same hosting account. Until you close that gap, any clean-up is temporary.
  2. Replace WordPress itself Reinstall the WordPress core files from WordPress.org, keeping only your wp-config.php file and wp-content folder.
  3. Reinstall plugins and themes from trusted sources Download fresh copies from WordPress.org or the developer’s own website, and remove anything you no longer use.
  4. Check uploads and the database Look for PHP files in the uploads folder (there should not be any), unfamiliar admin users, and scripts injected into posts, widgets or settings.
  5. Reset the security keys Generate new security keys and salts in wp-config.php. This logs everyone out, including anyone still holding a stolen login.

Restoring a backup from before the hack can save a lot of time, but only if you are sure it is clean and you have fixed the way in. Otherwise you are simply putting the same weakness back.

After the clean-up

Clear the warnings

Once the site is clean, request a review in Google Search Console so browser and search warnings are removed.

Repair your search results

Spam pages created by the attackers should return “not found” or “gone”, and your sitemap should be resubmitted.

Keep everything updated

WordPress, plugins and themes should be updated regularly, after testing, with unused ones removed.

Lock the doors

Use two-factor login for admins, keep daily backups stored away from the website, and add a firewall and uptime monitoring.

When to get help

If your site takes payments, holds customer details, or is showing warnings to visitors, it is usually worth having an expert handle it. A careful clean-up means more than removing malicious code. It means finding the way in, removing hidden backdoors and getting your site trusted again by Google, your hosting company and your customers.

Many of our clients first came to us after a hack. If you would rather we took care of it, see our hacked WordPress website repair service. If your site is down or showing warnings right now, call us on 0333 444 0283.

BackTop
X