WordPress

How a hacked WordPress site gets found and fixed

A hacked WordPress site can look fine for weeks. Here are the warning signs of a hacked WordPress site, how the cause is traced, and what closes the way in for good.

A hacked WordPress site rarely looks broken. It looks slightly off, and slightly off is easy to ignore. This article covers what a hacked WordPress site tends to show, how the cause is found, and how the way in gets closed, using two recoveries we handled.

Hacked WordPress site: abstract illustration of a magnifying glass over a web page with one highlighted line

The short version

  • A hack often shows up as something small and intermittent, like a redirect that only some visitors see.
  • Cleaning up the damage is only half the job. If the way in stays open, the intruder can come back.
  • Server records and a stored copy of your site’s code are how you find out what was touched.

Signs of a hacked WordPress site

A hacked WordPress site rarely announces itself. More often there is a small oddity that is easy to explain away. These are the ones worth taking seriously:

  • Visitors land on a site you do not recognize, sometimes only once, or only on certain devices.
  • Your dashboard lists administrators that nobody on your team created.
  • Your host or Google warns about malware or a deceptive site.
  • Plugins or files appear that nobody installed.
  • Search results show pages or titles you never wrote, or Google Search Console lists an owner or a sitemap you did not add.
  • Email from your site starts landing in spam, or stops arriving.

One sign on its own is not proof. Several together deserve a proper look.

Why a hacked WordPress site can go unnoticed

Intruders tend to avoid attention. In one recovery, a hidden redirect only sent some visitors to another site, so it came and went, and nobody could reproduce it until a colleague happened to see it. In another, the scanning and sign-in alerts that should have raised the alarm had been switched off, and the break-in sat there for about four weeks, until a routine release turned up files nobody on the team had put there.

That is why the first question after a scare is not “what do I delete?” It is “what happened, and when?”

How the cause of a hacked WordPress site is traced

Before anything is removed, the work is to understand what is there. The order matters:

  1. Keep copies. Anything suspicious is saved first, so there is a record of what was left behind.
  2. Compare the live site with a stored copy of its code. Anything on the server that is not in the stored copy needs an explanation.
  3. Check the database directly. Hidden administrator accounts do not always appear in the dashboard.
  4. Read the server’s access records. They show when the intruder arrived, how, and what they asked the site to do.
  5. Find out what was reached. Whether anything private was exposed is answered by the records, not by assumption.

Sometimes the records cannot say everything. They show what was asked of the site, not always what happened inside it. A good report states plainly what is known and what is not.

How the way in is closed for good

Removing the hidden files is the visible part. What keeps a site safe afterwards is closing the route the intruder used:

  • Replace every password and the site’s security keys, and sign everyone out, so no old session survives.
  • Remove everything that does not belong, then update whatever was out of date.
  • Switch off what the site does not need, such as installing plugins from the dashboard.
  • Turn on scanning and sign-in alerts, sent to someone who will read them.
  • Test the parts that matter to the business, such as a real checkout, before calling it done.

Restoring an old backup of a hacked WordPress site is not a fix on its own. It can remove the visible damage and leave the way in untouched. WordPress’s own hardening guide (opens in a new tab) covers passwords, updates and turning off file editing in more depth.

Two recoveries of a hacked WordPress site, in plain terms

Names and identifying details stay private, but the patterns are common.

Weak password

A hidden redirect and hidden admin logins

What happened

  • A bot guessed an administrator password by brute force.
  • Hidden code sent some visitors to an unrelated site.
  • A file browser and several admin logins were hidden on the site.
  • The attacker also verified ownership in Google Search Console and submitted its own sitemap, badly hurting search results.

What we did

  • Removed the code, file browser and logins.
  • Reset passwords and limited sign-in attempts.
  • Checked every page and file. Nothing had been changed.

Unpatched WordPress flaw

An unknown administrator, found about four weeks later

What happened

  • A serious WordPress flaw (known as WP2Shell) went public. Two days later an unknown administrator appeared on a site that had not been updated.
  • It signed in 63 times over about 32 hours.
  • Hidden files that looked like plugins were added.
  • Alerts were off. It was found about four weeks later during a release, when the live site had changes we had not put there.

What we did

  • Removed the hidden files and the account.
  • Closed the way in and replaced passwords and keys.
  • Turned on scanning and sign-in alerts.
  • Checked the host records. They showed no customer data was accessed.

A note on two-factor login: it is worth turning on, but it would not have stopped the second case. The intruder created a brand new administrator account instead of guessing an existing one.

What a hacked WordPress site costs when it is left alone

A hacked WordPress site is not only a security problem. It is a business problem that grows with every week it goes unnoticed. Visitors who are sent to another site may not come back. Search engines can flag the site or show pages you never wrote, which hurts how your business appears when people look for it. Email from the site can start landing in spam, so customers miss order and booking messages. And if the site takes payments or collects personal details, the question of what was exposed becomes a matter of trust as well as a technical one.

The second cost is time. The longer an intruder has access, the more there is to check afterward: more files, more accounts and more records to read. In the second recovery above, the break-in sat for about four weeks, and that is four weeks of changes that had to be reviewed before anyone could say what was and was not touched.

The third cost is the next attempt. A hacked WordPress site that is only cleaned, and never traced, can be found again by the same kind of automated tool that found it the first time. That is why the order in this article matters: understand, remove, close the way in, then watch.

What to check on your own site today

  1. Open Users in your dashboard and look for administrators you do not recognize.
  2. Update WordPress, your theme and your plugins, starting with anything marked as a security fix.
  3. Replace weak or reused administrator passwords.
  4. Turn on sign-in alerts and make sure they reach a real inbox.
  5. In Google Search Console, open Settings and check the list of verified owners and the sitemaps submitted. Remove any you do not recognize, using Google’s guide to managing owners (opens in a new tab).
  6. Find out whether your site has a recent backup, and whether anyone has tested restoring it.

If you think you have a hacked WordPress site and find something you cannot explain, do not delete it yet. Take a copy first, so the cause can still be traced. If anything on this list looks wrong, stop and get help before you delete or restore anything. See how Xcelsior Care handles this.

Not sure what your site is telling you?

A free site check-up looks at what can be seen from the outside and tells you in plain language what to do next.

Request a free site check-up

Questions people ask

How do I know if I have a hacked WordPress site?

Look for the signs above: redirects, administrators you did not create, warnings from your host or Google, and files or plugins you did not add. A single sign is not proof, but several together mean it is worth a proper check.

Can I just restore a backup?

A backup can remove the visible damage, but it usually brings back the same weakness the intruder used. Find out how they got in first, then clean or restore.

Were my customers’ details taken?

It depends on what the site could reach and what the records show. The answer comes from the server’s records, not from assumption, so ask for them to be checked before you tell anyone either way.

Can Xcelsior clean up a hacked WordPress site?

Yes. We find out what happened and how the intruder got in, remove what they left, close the way in, and set up alerts so the next attempt is noticed quickly. Start with a free site check-up.

How long does it take to clean a hacked WordPress site?

It depends on what was left behind and how much needs to be checked. Removing the files is quick. Tracing the cause and confirming what was reached takes longer, and it is the part worth paying attention to.

Keep reading

More on security.

All articles

Start with a free site check-up.

Request a free site check-up
  • Free, no obligation
  • Report in 3 business days
  • Nothing on your site is changed