Some security stories start with a dramatic warning. This one started with a page that should have been boring.
One of my clients has a personal WordPress portfolio website: an About page, a few posts, nothing unusual. When I opened the About page, the owner’s story was gone. In its place was a long, glossy page about online casinos. It was written in another language, made to look like a well-known news website, and full of links pointing to a gambling site.
My first reaction was the one most WordPress people have: “Which plugin was vulnerable?” Over the next few weeks I learned that no plugin was to blame. WordPress had not been broken into at all. And this one hacked page turned out to be the small visible corner of something much bigger, spread across two hosting servers and hundreds of websites.
This series is my honest, step-by-step account of how I worked it out. I am writing it for developers, site owners and people who run small hosting businesses, because I think the lessons apply to many of us, especially those hosting websites for schools, NGOs and small businesses.
In this first part, I explain how I worked out that the problem was not WordPress.
A note on privacy: I have removed every website address, client name, server name and real IP address from this series. The screenshots are anonymised recreations of what I saw, built from the real structure but with placeholder data. Nothing here exposes a password or a client.
Step 1: Don’t panic, and don’t delete anything yet
When you see a hacked page, the instinct is to delete it right away. I understand that instinct, but the first job is to look, not to clean (see how I save evidence before cleaning). Every file an attacker leaves behind carries information: when it was created, where it sits and what it contains. Delete it too early and you lose the timeline.
So before touching anything, I wrote down three things:
- What exactly is wrong? The About page shows casino spam instead of the real content.
- When did it start? I didn’t know yet, but file dates would tell me.
- What else might be affected? Assume more than you can see.
Step 2: Ask how the spam page is being served
This is the question that changed the whole investigation.
In WordPress, the About page lives in the database. When someone visits /about/, WordPress reads the database and builds the page. So I had to ask: was the database changed, or was something else answering that address?
I opened the site’s files in cPanel’s File Manager. (Here is how to find recently changed files in File Manager.) Inside the website folder (public_html) there was a brand-new folder called about, containing a single file, index.html, about 350 KB in size.

That explained everything about the page. On most servers, a real folder on disk takes priority over a WordPress permalink. When a visitor asks for /about/, the web server finds the physical about/ folder, serves its index.html, and never asks WordPress at all. The real About page was still safe in the database. It had simply been covered over.
It was a clever trick, and it told me something important straight away: whoever did this had the power to create files on the server. That is a very different thing from posting spam through a comment form.
Step 3: Look at what sits next to it
Right beside the fake folder was a tiny file with a name like google0a1b2c3d4e5f6a7b.html, only 53 bytes.
If you have ever added a website to Google Search Console, you will recognise it. Google gives you a file with a unique name and asks you to upload it to your site to prove you own it. Once it is there, Google treats you as an owner of the site in Search Console.
So the attacker wasn’t just putting up a spam page. They were claiming the website in Google, so they could:
- see how the spam was performing in search
- ask Google to index their pages quickly
- control parts of how the site appears in Google results
The folder was created at 10:34 and the verification file at 10:35. One minute apart. These were planned steps, not an accident.
Step 4: Check whether WordPress itself was touched
Before blaming the hosting account, I had to rule out WordPress properly. “I don’t think it’s WordPress” is not good enough. I needed proof.
Here is the checklist I ran, with the tools I used.
1. WordPress core files. WP-CLI can compare every core file against the official checksums published by WordPress.org:
wp core verify-checksums
New to the command line? See my guide: How to Open the Terminal in cPanel and Run WP-CLI.
If any core file has been changed, or there are extra files that shouldn’t exist, it lists them. Mine returned a clean result: all 3,338 core files matched.
2. Plugins from WordPress.org:
wp plugin verify-checksums --all
This only works for plugins hosted on WordPress.org. Premium plugins and themes have to be checked by reading them.
3. The uploads folder. The uploads folder should hold images and documents, never PHP. This command finds any PHP hiding there:
find wp-content/uploads -type f -name '*.php'
Mine returned nothing.
4. wp-config.php and .htaccess. I read both files line by line. Attackers like to hide a single line in them that loads their own code. Both were clean.
5. The database. I checked users, posts and settings. There was only one user, the real administrator, and no spam posts and no injected scripts. New user registration was switched off.

All clean. WordPress had not been compromised.
Step 5: Understand what that means
This is the moment I want every reader to sit with, because it is uncomfortable.
If WordPress wasn’t broken into, yet someone created files directly on the server, then the attacker came in through the hosting account itself. Most likely they logged into cPanel, or used FTP, with valid credentials.
That changes everything about the fix:
- Updating plugins won’t help.
- Changing the WordPress admin password won’t help.
- Even a security plugin wouldn’t have stopped it, because the attacker never went through WordPress.
The only real fix is to find out how the attacker got into the hosting account, close that door, and remove anything they left behind to get back in.
In the next article I walk through the cleanup itself, and then I show what I found when I looked inside cPanel: two hidden “back doors” that would have let the attacker return even after the password was changed.
What I want you to take from Part 1
- Look before you clean. Write down file names, sizes and dates before deleting anything.
- Ask how a page is being served, not just what it says. A physical folder can silently override a WordPress page.
- Google verification files you didn’t create are a serious warning sign. Someone is trying to claim your site.
- Prove WordPress is clean with
wp core verify-checksums, plugin checksums, a search of uploads for PHP, and a read ofwp-config.phpand.htaccess. - If WordPress is clean but files appeared anyway, look at the hosting account. That is where this story really begins.
Next in the series: Part 2, “Cleaning a Hacked WordPress Site Properly, Not Just Quickly”.
