TL;DR
- A steel-building manufacturer, a client since 2019, ran its brand sites and a dealer's store on a self-managed server: CentOS 6 past end of life, PHP 5.4, WordPress several versions behind, and no server-level backups at the host
- May 2019: the whole server was compromised. We cleaned it, rotated every secret, upgraded PHP, deleted abandoned test sites, and told the client the operating system had to go
- February 2020: the dealer's store was taken over during its busy season through a plugin vulnerability that had been public for eleven months. Seventeen of eighteen active plugins were out of date
- June 2020: the same store was hacked again. A rogue administrator account had published 117 payday-loan posts; the cleanup took months because 20,000 spam URLs kept drawing traffic
- August 2024: all twelve sites moved to Nexcess managed WordPress behind Cloudflare, each with a security plugin, bot filtering, and updates handled. No site compromise since
An Unpatched Server With a Dozen Sites on It
The manufacturer had been building steel buildings for decades and had accumulated websites the way manufacturers do: one per brand, one per product line, one for a dealer, plus old test copies nobody deleted. They lived on a dedicated server the client rented directly, with a control panel the in-house designer used for uploads and nobody responsible for the operating system underneath.
By 2019 that meant CentOS 6, which had reached end of life, PHP 5.4, and WordPress installs that updated when someone remembered. The dealer's store had ten administrator accounts. One of the brand sites was still on a WordPress release that had reached its own end of life years earlier.
What the first incident exposed:
- The host kept only disaster-recovery backups, not restorable site backups
- Old and "beta" copies of sites were still live and reachable
- Abandoned themes and plugins were installed but never updated
- Database and WordPress secrets had never been rotated
Three Cleanups, Each With the Cause Named
May 2019, the server. Uptime monitoring showed every site down on a Saturday. The control panel logs showed hacked files and attacker activity. Over the weekend we cleaned the infected files, updated plugins and security on the brand sites, changed the WordPress salts and the database password, removed unused themes, deleted the old and beta sites, installed PHP 5.6, 7.0, and 7.1 and moved every site up from 5.4, and banned the attacker addresses from the logs. We also put it in writing that the operating system was end of life and the host needed to upgrade it. Google flagged the server's IP as deceptive that November from having crawled the sites while they were compromised; the residue took months to clear.
February 2020, the dealer's store. The dealer wrote that "a BOT has already taken over the website" in the middle of its busy season. The store was on WordPress 4.5 when 5.3 was current, 22 plugins needed updates, 17 of 18 active plugins were out of date, and the entry point was a cross-site scripting bug in an abandoned-cart plugin that had been public since March 2019. We fixed it, updated the vulnerable plugin, and told the dealer that "regular, monthly updates to your website would have prevented this problem," with a care plan offer attached.
June 2020, the dealer's store again. This one was worse. We removed the hacked files, updated core, compared every core file against a clean download, deactivated every administrator but three, and found the user that had been added, who had published 117 blog posts promoting payday loans. We rotated the salts and the database and FTP passwords and installed a premium security plugin, with a warning the client needed to hear: "just using the pro version of the security plugin isn't going to solve all of the problems. If they aren't keeping up on their WordPress core files or their plugins, then a serious vulnerability will be able to bypass the security plugin."
The aftermath ran into October. Search engines had indexed more than 30,000 spam URLs, the site was using four times its resource allocation answering 404s for them, and we spent hours retiring about 20,000 of them with 410 responses so crawlers would stop asking. The client's reaction to the second hack: "Is there some sort of 'anchor/homing device' somewhere in our site?"
The structural fix, 2024. The sites later moved to a cPanel server that started emitting malware-scanner and end-of-life notices of its own. In August 2024 we migrated all twelve sites, five on WordPress and seven in static PHP and HTML, to Nexcess managed WordPress behind Cloudflare, cutting DNS over at 9 PM with the client's paid campaigns paused. Monitoring showed the speed jump before we had even enabled caching. Each WordPress site then went through a post-migration checklist: security plugin, SMTP for form delivery, Cloudflare Turnstile on forms, page caching, and spam filtering.
What Changed
- Three compromises cleaned with the entry point identified each time, instead of a scan-and-clean cycle that would have repeated
- Every secret rotated and the administrator count cut from ten to three on the site that kept getting hit
- 20,000 spam URLs retired so the store stopped paying for the attacker's traffic
- Twelve sites on isolated managed hosting behind Cloudflare since August 2024, with updates, firewall, and form protection handled as part of hosting
- No site compromise since the migration. The only security tickets after it have been a form sender failing authentication on a shared mail server and a responsible disclosure of a dangling subdomain, both fixed without an incident
The client has since added a new brand site to the same platform every year.
Frequently Asked Questions
Why does a WordPress site keep getting re-infected? Because the hole is still there. Every one of these compromises came through software that was out of date: an end-of-life operating system, an abandoned-cart plugin with a known bug, a store on a years-old WordPress release. Cleaning removes the attacker's files. Updating removes the way in. If only the first happens, the next infection is a matter of weeks.
Does a security plugin stop this? It helps and it is not enough. We told this client so after installing one. A security plugin can block brute-force logins and known attack patterns, but a vulnerability in core or a plugin can bypass it. Updates, a firewall in front of the site, and few administrators matter more.
What does a Web Application Firewall change? Cloudflare in front of the site blocks the exploit attempts, scanners, and bots before they reach WordPress at all. After the 2024 migration, that layer plus a managed host that applies updates is why the pattern stopped. The sites did not get smarter; the attackers stopped reaching them.
How long does cleanup take after a spam-post hack? The files and accounts can be fixed in a day. The search-engine fallout can take months. This store had tens of thousands of spam URLs indexed, and every crawler request for one of them cost server resources until we retired them with the correct response codes. Plan for the long tail.
When is it time to leave a self-managed server? When nobody is responsible for the operating system. This client's server ran an end-of-life OS for years because the in-house designer managed sites, not servers, and the host only touched what it was paid to touch. Managed hosting moves that responsibility to a vendor whose business depends on patching.