Hacked WordPress site: how to spot the attack, clean it up and get your site back

Redirects to other sites, spam pages in Google, an admin account nobody recognises: a hacked WordPress site shows a few precise signs. Here is how to react in the first hour, clean the site thoroughly and keep it from being hacked again.

The essentials in 30 seconds

  • A hacked WordPress site is a site an attacker has taken control of to plant malicious code: traffic redirects, spam pages, a fake payment form or a hidden admin account.
  • 11,334 new vulnerabilities were recorded in the WordPress ecosystem in 2025 (+42% in a year, 91% in plugins), and the most targeted ones are mass-exploited 5h after being published.
  • The first hour is about limiting the damage and keeping the evidence: site offline, a copy of the hacked state, passwords changed from a clean computer.
  • Cleanup happens in three steps: diagnosis, full cleanup of files and database, then closing the entry point, otherwise the site is often hacked again within the week.
  • Google does not lift the warning on its own: a review request in Search Console takes from a few days to a few weeks.
Read the full article
Gloved hands typing on a laptop in the dark
Photo : Towfiqu barbhuiya, Unsplash

Why WordPress hacks are on the rise right now

WordPress hacks are increasing because vulnerabilities are more numerous and exploited faster. Patchstack, a cybersecurity company specialising in WordPress, recorded 11,334 new vulnerabilities in the WordPress ecosystem in 2025, 42% more than in 2024, 91% of them in plugins. For the most targeted flaws, the median time before mass exploitation is only 5h after publication.

The increase also shows in what people search for. On Google in France, searches about redirects, cleanup and hacked WordPress sites have grown roughly tenfold since mid-2026 (Semrush data, November 2026). On 18 November 2026, a site owner was still describing on the OVHcloud forum a WordPress site that had become unreachable overnight, redirected to a gaming site in Thailand.

What I see in the field points the same way. On the 4 hacked sites I have repaired, the cause was always mundane: an outdated plugin, poorly managed access, a reused password, an obsolete PHP version. None of them was targeted personally. WordPress runs nearly 4 out of 10 websites worldwide (38.4% according to W3Techs, November 2026), which makes it a prime target. Attacks are automated: bots test the same flaw on thousands of sites, and a small business is as interesting a target as a large one, because it is often less closely watched.

The signs of a hacked WordPress site

The signs of a hack are often subtle, because the attacker wants to stay on the site as long as possible. Some show up when you visit the site, others only in Google, in the WordPress dashboard or in the server logs. A free tool like Sucuri SiteCheck scans a page as seen from outside, but it sees neither the files nor the database: a clean result proves nothing. A single one of these signs is enough to justify a diagnosis.

A redirect to another site

This is the symptom that comes up most in searches in 2026: the visitor lands on your page, then is sent to a gaming site, an online pharmacy or a fake virus alert. The redirect sometimes only affects visitors coming from Google, or only mobile users, and never the logged-in administrator: you may see nothing for a long time. To check, test your site from a phone, in private browsing, by clicking on a Google result.

That is what happened to Parismatic Tour, a guided tour company in Paris: its WordPress site redirected visitors to other sites, then went down. The site was back online in under 2h thanks to a quick fix, then thoroughly cleaned and restored in 2 days, before being replaced by a custom-built site with no CMS to hack.

Spam pages in Google

Type site:yourdomain.com into Google. If pages in Japanese, casino titles, online betting or medication show up, the site has been infected with spam: the attacker created thousands of pages to ride on your domain’s reputation. In Google Search Console, the “Security issues” report and a sudden rise in indexed pages confirm it.

An unknown admin account or suspicious activity

In the WordPress dashboard, open the list of users: an administrator account nobody knows, recently created, is proof of an intrusion. Other clues should raise the alarm: a plugin installed that you never added, PHP files in the images folder, mass emails sent from your hosting, a site slowing down for no reason.

A warning from Google or your host

The red “Dangerous site” message shown by Chrome, a Search Console warning, or a host that suspends the site or puts it in maintenance: at this stage, the hack is visible to everyone, and every day costs visits and customers. Don’t reinstall anything in a hurry: the message only goes away after the review described below.

What to do in the first hour

In an emergency, the first hour of an incident is about limiting the damage and keeping the evidence, not fixing everything. The reflex of wiping everything and restoring a random backup destroys the traces that show how the attacker got in. Here is the action plan I follow on every urgent intervention:

  1. Take the site offline or put up a maintenance page, to protect visitors.
  2. Make a full copy of the files, the database and the server logs, in their hacked state.
  3. Change the passwords for the hosting, FTP, MySQL and email accounts, using a clean computer.
  4. Alert your host, who may have spotted the attack in their own logs.
  5. Write down how the incident unfolded: date, time, symptoms, screenshots.

If an in-house team or an agency manages the site, tell them right away: they may have access to change too. If the site sells online or collects information (forms, customer accounts, WooCommerce), add one check: could personal data have been read? The answer determines your GDPR obligations, detailed below.

How to clean a hacked WordPress site

Cleaning a hacked WordPress site means replacing everything that can be replaced with original files, then checking by hand what is specific to your site: the database tables, the child theme, the uploaded files. A partial cleanup, which only removes the visible malicious code, almost always leaves a backdoor behind.

Start with a diagnosis

The diagnosis answers two questions: how did the attacker get in, and what did they change. Before touching any file, I analyse the server logs around the date of the first symptoms, the list of suspicious files modified recently and the version of every plugin, compared with published vulnerabilities. Without this diagnosis, the cleanup treats the symptom, and the problem comes back soon after.

Reinstall WordPress, the plugins and the theme

The safest approach is to reinstall the WordPress core and each plugin from their official source, rather than hunting for infected code line by line. This reinstall touches neither your content nor your settings, which live in the database. With WP-CLI, the wp core verify-checksums command compares the core files with those from WordPress.org, and wp plugin verify-checksums --all also checks plugins from the official directory. Premium plugins and the theme should be reinstalled from the vendor’s archive. Take the opportunity to uninstall any unused plugin: every plugin is a possible way in.

Remove suspicious files and clean the database

What remains are the site’s own files: the wp-content/uploads folder must not contain any PHP file, and wp-config.php must be read in full. In the MySQL tables, I look for suspicious scripts injected into posts and options (<script, eval(, base64), unknown scheduled tasks and added accounts. That is often where the redirect hides.

Reset all access

Once the site is clean, it has to be secured: reset the passwords of all WordPress users, delete unknown accounts and regenerate the security keys in wp-config.php, which logs out every open session, including the attacker’s, who can no longer reach the admin. Add an extra layer with two-factor authentication for every administrator.

Restore a backup: only if it is clean

Restoring your site from a recent backup is the fastest route, on one condition: the backup must predate the intrusion, which often goes back several weeks before the first symptoms. A restore without fixing the vulnerability puts the site back online with the same door open. You also lose the orders, messages and content created since the backup date: weigh that against the cost of a cleanup.

Getting off Google’s red list

Once the cleanup is done and the site is back online, Google does not lift the warning on its own: you have to request a review from Search Console, in the “Security issues” report. According to Google, this review takes from a few days to a few weeks. The request must explain what was fixed; a request sent too early, while malicious code remains, is rejected and extends the delay. Before sending it, scan the files and the flagged pages again.

For a spam hack, the pages created by the attacker must also disappear: let them return a 404 or 410 error, and request their temporary removal in Search Console if there are many. Traffic comes back gradually, over a few weeks, as the hacked pages drop out of the index. Keep an eye on indexed pages for a month after the site is back online.

The risks of waiting

Every day of waiting makes the hack more costly: downtime, lost visits, lost Google rankings, damage to your reputation and, if data leaked, legal obligations. Browsers try to protect their users: as long as the warning is shown, a flagged site loses most of its visits. A hacked site is also often used to attack other people: spam sent from your server, phishing with your domain name, malware passed on to visitors.

If personal data may have been read (customers, accounts, forms), the GDPR requires you to notify the breach to the data protection authority (the CNIL in France) within 72h of becoming aware of it, and to inform the people concerned if the risk to them is high. For a WooCommerce store, the loss is counted in orders: a product that no longer displays or a hijacked payment page drives customers away, and the loss of trust lasts longer than the outage. Filing a complaint is also possible: in France, an intrusion into a website is an offence against an automated data processing system, punishable by two to seven years in prison depending on the case, as Cybermalveillance.gouv.fr points out.

Security plugins: useful, not enough

A security plugin like Wordfence or Sucuri monitors the site to detect suspicious activity: modified files, login attempts, known malware. It blocks part of the automated attacks, such as rapid-fire password guessing on the /wp-admin login page. The free version of Wordfence is often enough for a showcase site; the paid plan applies new firewall rules in real time, while the free version receives them 30 days later. But a plugin runs inside WordPress: if the attacker already has control, they can disable or bypass it.

My view, after several cleanups: installing a security plugin replaces neither updates, nor off-server backups, nor secure hosting. A WordPress site with Wordfence but three abandoned plugins is still vulnerable. To strengthen security, I prefer fewer plugins, all up to date, and monitoring that comes from outside the site.

How to prevent another hack

Preventing another hack means securing your site where attackers get in most often, and being able to react quickly if a flaw still gets through. The table below sums up the security measures that prevent a new incident, in order of effectiveness, based on the causes I found on the sites I repaired.

Measure What it prevents Frequency
Update WordPress, plugins and theme Exploitation of a published flaw Every week, security fixes within 24h
Remove unused or abandoned plugins Flaw with no fix Every quarter
Two-factor authentication and a unique-password policy Admin account takeover Once, then for each new user
Daily off-server backup, tested Loss of the site, restore impossible Every day, tested monthly
Supported PHP version Vulnerabilities in the PHP language Check every six months

Automatic plugin updates, available since WordPress 5.5, help on small sites, but they can break a page without warning. On a site a business depends on, I recommend testing each plugin update on a copy before applying it live. To find out where your site stands, a website audit reviews versions, access and backups. To go further, I have detailed these measures in the article how to secure a website, and a website maintenance plan takes care of them every month.

Clean it yourself or call in an expert?

Doing it yourself is possible if the site is simple, if you have a clean backup and the technical skills (FTP, MySQL, WP-CLI). As soon as the site sells online, the entry point is not identified or Google shows a warning, an expert can clean the site and strengthen its security faster, and avoid a second infection, which is the most common outcome of a rushed cleanup.

Before choosing a freelancer or a team, check three points. Is the cause investigated, rather than just deleting the visible code? Will you get a technical report of what was found and fixed? Is there follow-up and support after the site is back online? A guarantee against the same hack, for a period written into the quote, is a good sign. Compare prices for the same scope: a cleanup without root-cause analysis costs less, but you often end up paying twice. Be wary of promises of total security: no site is 100% protected.

Is your site hacked, or do you have a doubt? Get in touch: my hacked website repair service, for WordPress or PrestaShop, includes the diagnosis, the cleanup, the fix for the flaw and the Google review request, at the published price, and I can step in the same day if needed. For an online store, also read what to do when a PrestaShop store is hacked.

Sources

Hacked WordPress site: frequently asked questions

How long does it take to clean a WordPress site?

It depends on how far the infection has spread: for Parismatic Tour, the site was accessible again in under 2h with a quick fix, and the full cleanup took 2 days. A simple infection, limited to a handful of files, is dealt with faster; an infection of the database or of several sites on the same hosting takes longer. Getting the Google warning removed comes afterwards, within the delays given above.

Can my host clean my WordPress site?

Most shared hosts suspend the site and flag the infected files, but they don’t work on its content: that is the owner’s responsibility. Some offer a paid malware-removal service; check that it includes finding the cause.

Is a backup enough to recover a hacked site?

No, not on its own. A clean backup puts the site back in a clean state, but the entry point used by the attacker is still there. To avoid a relapse, update the plugin at fault and change the access credentials, otherwise the site gets hacked again, sometimes within days.

Should I file a complaint when my site is hacked?

It is recommended, especially if customer information or payments are affected: the complaint helps with your insurer, your bank and in any dispute with a customer. Keep the copy of the hacked site and the server logs as evidence. In France, Cybermalveillance.gouv.fr helps businesses that fall victim through these steps.

Does a hacked WooCommerce store expose credit cards?

If payment happens on the bank’s or Stripe’s page, card numbers don’t go through your server. The risk still exists: an attacker can display a fake card form on your own page. That is what I found on a PrestaShop store in October 2026, and the same technique exists on WooCommerce.

Read next

Let’s talk about your project

Write to me: I reply within one working day, with a first opinion or an offer of a 30-minute video call, even if we never work together.