Chinmoy Biswas

Hacked WordPress Site Keeps Coming Back? How I Recovered One in 24 Hours

Google flagged a client's site as dangerous, visitors were redirected to spam, and the hack came back days after a clean-up. The way in was a nulled Elementor Pro. Here is how I found it, cleaned files and database, and recovered the site in 24 hours.

On this page
  1. Why a clean-up often doesn't last
  2. Step 1: Find the way in
  3. Step 2: Find everything they left behind
  4. Step 3: Clean files and database together
  5. Step 4: Close the door
  6. Step 5: Clear the Google warning
  7. The real cost of a nulled plugin
  8. If you think your site has been hacked
  9. Is your WordPress site hacked?
Hacked WordPress Site Keeps Coming Back?

Few things hurt a small business like seeing a red warning on its own website.

While I was a senior WordPress developer at SEOPage1, a small consulting firm came to us in exactly that state. Google had flagged the site as dangerous. Visitors arriving from search were being redirected to spam sites. Google's results for the domain were full of spam pages the firm had never written. And there were admin accounts in WordPress that nobody at the firm had created.

The worst part: another developer had already cleaned the site once. Within days, the hack was back.

I had the site clean, closed and back to normal within 24 hours, and this time it stayed clean. Here's how, and why the first clean-up didn't last.

Why a clean-up often doesn't last

A hack that keeps coming back nearly always means the same thing: the clean-up removed the damage but left the way in.

Malware on a WordPress site usually comes in layers:

  1. The entry point: how the attacker got in, such as a vulnerable plugin, a stolen password or a pirated plugin with a backdoor.
  2. Persistence: the things they leave behind so they can get back in, such as hidden PHP files, extra admin users and code stored in the database.
  3. The payload: what visitors and Google see, such as spam redirects and spam pages.

Most quick clean-ups only remove layer 3, because that's what's visible. Layers 1 and 2 quietly rebuild it.

So I didn't start by deleting anything. I started by finding the door.

Step 1: Find the way in

I went through the site in a fixed order: the plugin and theme list, then the files, then the database, looking for anything that didn't belong.

The trail led to one plugin: Elementor Pro, installed from a nulled copy.

"Nulled" means a pirated copy of a paid plugin, with the licence check removed and given away free on unofficial sites. It looks like a saving. But somebody edited that code before giving it away, and people rarely do that for nothing. Inside this copy was a backdoor: a block of obfuscated code, deliberately scrambled so it doesn't look like code at first glance. The PHP equivalent of a spare key taped under the doormat.

That backdoor explained everything. As long as the nulled plugin was installed, the attacker could get back in and rebuild whatever had been cleaned.

Step 2: Find everything they left behind

With the entry point known, I hunted for persistence, because removing the plugin alone wouldn't be enough.

  • Extra PHP files. There were PHP files in places PHP should never be, such as the uploads folder, which should only hold images and documents. Those files were small tools for the attacker: ways to upload, run code or recreate the infection.
  • Unknown admin users. The accounts the firm hadn't created were the attacker's own logins. Delete the files but leave the users, and they can simply sign in and start again.
  • Database injections. Malicious scripts were stored in the database itself, in the places WordPress loads settings and content from. This is the layer most clean-ups miss. If you only clean files, the database can put the redirect straight back on every page.

Step 3: Clean files and database together

I cleaned every layer in one go, so nothing could rebuild anything else in between:

  • Core files: compared WordPress core against clean official copies and replaced anything that had been changed
  • Themes and plugins: reinstalled from official sources instead of trying to clean them line by line
  • Uploads: removed every PHP file from the uploads folder
  • Database: removed the injected scripts and checked the settings and content for anything else foreign
  • Users: deleted the unknown admin accounts and reviewed every remaining user's role

Step 4: Close the door

Cleaning is only half the job. To make sure it couldn't come back, I:

  • Removed the nulled Elementor Pro completely and installed a properly licensed copy from Elementor
  • Changed every password: WordPress admins, hosting, database and FTP/SFTP, since the attacker could have seen any of them
  • Refreshed the WordPress security keys, which signs everyone out, including any attacker with a stolen session
  • Updated WordPress, the theme and every remaining plugin
  • Removed plugins and users the firm didn't need
  • Set up regular backups and basic security monitoring, so any new change would be noticed quickly

Step 5: Clear the Google warning

With the site clean, I requested a review through Google Search Console, in the Security Issues report. Google checks the site again and lifts the warning when it's satisfied. Once it was lifted, visitors stopped seeing the warning, the redirects were long gone, and search traffic could start to recover.

The spam pages in Google's results take longer to disappear, because Google has to recrawl each address and find it gone. A clean sitemap and removal requests for the worst spam URLs speed that up.

The real cost of a nulled plugin

A licence for a premium plugin costs a modest yearly fee. For this firm, the free copy cost:

  • days of a site that warned visitors away
  • spam on its own domain, in front of potential clients
  • two clean-ups instead of none
  • lost search traffic that takes time to win back

Never install nulled plugins or themes. If a premium plugin is too expensive, a free alternative from the official WordPress directory is far safer than a pirated copy of the paid one.

If you think your site has been hacked

  1. Don't only delete what you can see. Find the entry point first, or it will come back.
  2. Check the user list for admins you don't recognise.
  3. Look for PHP files in wp-content/uploads. There shouldn't be any.
  4. Clean the database as well as the files.
  5. Reinstall plugins and themes from official sources instead of trying to fix infected copies.
  6. Change every password and refresh the security keys once the site is clean.
  7. Ask Google for a review in Search Console when you're done.
  8. Keep backups you can actually restore, and keep everything updated.

Is your WordPress site hacked?

If your site has been flagged, is redirecting visitors, or keeps getting reinfected after a clean-up, I can help. I find the way in and close it, not just the symptoms. Get in touch and tell me what you're seeing.

← Back to writing