The PHP Exploit Fix and the Downtime Question
Last week I had a cPanel box open in one terminal and a Google help doc in the browser, both about the same problem: a google php exploit fix on a server that was still serving live traffic. The PHP2Shell exploit landed in the same news cycle as Google’s guidance on removing a site from Search while you repair it, which is why the timing question came up at all. Plenty of site owners read both items and concluded they were supposed to pull the site down first and ask questions later.
For most of you that is the wrong order. The fix is a server job: patch PHP, find the dropped files, clean them, rotate everything the attacker could have read. Taking a site offline is a containment step for the cases where you cannot vouch for what the box is serving. It is not the repair. I have watched people flip on maintenance mode within ten minutes of a scare and then spend two days reading logs. The downtime bought them nothing they could not have had with the site up.
The analogy I keep coming back to is a shop with a broken back door lock. You change the lock. You do not board up the storefront and turn customers away for the afternoon, unless you think someone is still inside.
So this post is about ordering, not panic. Google published specific options for handling Search when a site genuinely has to come down, and the choices are not interchangeable. A 503 with Retry-After, a 404, and a robots.txt block all behave differently in the index, and one of them costs you rankings you did not need to lose. The roundup that pointed me at Google’s doc is here: Search News Buzz Video Recap (opens in new tab).
Here is what PHP2Shell actually is, what Google recommends for a short takedown, and the runbook I run on my own boxes before I would ever consider pointing a vhost at a maintenance page. If your site is clean after the file check, none of the takedown advice applies to you and you can skip the rest.
Background: What the PHP2Shell Exploit Actually Is
The name is a label the security community attached, not a vendor advisory number I can point you at. What it describes is a familiar class of bug: a PHP application accepts input it should never trust, and an attacker turns that input into code that runs on your server with the same permissions as your web user. In practice that means whoever lands it can read your wp-config.php or .env, list your database, drop a file into /uploads, and come back through that file whenever they like. That last part is what people miss. The initial request is the entry, the webshell is the residency.
Shared hosting and cPanel boxes are the exposed surface because that is where PHP is oldest, where users run three-year-old plugin versions because a theme update broke something, and where one compromised account sits on the same machine as twenty others. I run a handful of these boxes for customers and the pattern is always the same. Nobody knows what PHP version the account is on until you ask them to check. I have found 7.4 installs still serving traffic long after upstream stopped patching them, not out of malice, just because it worked and nobody looked.
Google’s guidance on taking a site down is not about the exploit itself. It is about the Search side consequence. Their help documentation lays out three ways to tell Google to stay away: return a 503 with a Retry-After header for a temporary outage, return 404 for pages that are gone permanently, and use robots.txt to block crawling. These are not equivalent. The 503 signals “come back later” and Google keeps the URLs indexed while it waits. A 404 removes them. A robots.txt block stops the crawl but does not stop the URL from being indexed from what Google already knows, and because crawlers cache the file, you can lock yourself out for longer than the outage lasted.
The other thing worth knowing is that Search Console has its own removal tools for individual URLs, which is a different lever from a sitewide takedown. If one page is serving something malicious and the rest of the site is fine, removing that page is faster and cheaper than taking the whole site dark. Google published the outage guidance the same week the exploit chatter spiked, and the framing assumes you are doing this for hours or days, not months. That assumption matters when you pick your status code.
What’s Happening Now: Google’s Google PHP Exploit Fix Guidance
Google put out guidance on how to handle Search if you have to take a site down while fixing the PHP exploit, and the timing is not accidental. The exploit noise and the help doc landed in the same week. Barry Schwartz covered the whole week in the Search News Buzz video recap (opens in new tab), which is where I first saw the takedown item grouped next to the usual ranking chatter.
The guidance itself is short and mostly points back to the existing removal levers: temporary 503, permanent 404, Search Console URL removal, and robots.txt. What it adds is context about which one fits a security fix. The short version is that Google treats a server outage as temporary and expects you back, so a 503 with Retry-After keeps your URLs in the index. That is the outcome you want when the fix takes a weekend.
Same week, Google updated its help doc on controlling what you share with Search, and posted a video on robots.txt rules for AI crawlers, emoji, and international URLs. Worth watching if you have been using robots.txt as a blunt instrument, because the rules around AI crawlers are stricter than people assume and a stray User-agent: * line hits more than you think.
On the ranking side there was another round of volatility chatter on October 20 and 21 with no confirmed core update behind it. I have stopped reading dips during a 48 hour window like that as anything meaningful. There is no update to attach them to.
The adjacent news is a set of three studies questioning whether AI visibility and GEO work is worth the spend, which is a debate I have mixed feelings about. Small sites I host are not getting AI search traffic in any volume I can measure, so the ROI question feels early. Google also moved Business Profile posts higher in the local panel, is testing government ID verification for profiles, and expanded Ads financial services verification to the US and Canada. If you run local listings for clients, the posts change matters more than the study headlines.
The one thing I would act on from this week is the takedown guidance, because it tells you what to do before you are panicking with a compromised box.
Should You Take Your Site Offline for the PHP Exploit Fix?
Q: Do I have to take my site down to fix PHP2Shell?
No. Patch, verify, then confirm nothing malicious remains. Downtime is for containment, not for the fix itself. If the attacker is still active and you cannot tell where they are, pulling the site offline buys you time to work without them watching. That is the only case where I reach for it first.
Q: What does Google recommend if I do need to take it down?
Return 503 with a Retry-After header, keep it temporary, and do not use robots.txt for a short outage. The guidance landed last week alongside the PHP2Shell coverage in Barry Schwartz’s news recap (opens in new tab), and it is short enough to read in a few minutes. Read it before you need it. A compromised host is not the moment to be choosing HTTP status codes from memory.
Q: 503 or 404 or robots.txt?
503 for hours or days. 404 only if pages are gone for good, because it tells Google to drop the URL and you are stuck waiting for recrawl when you come back. robots.txt never for an outage, because crawlers cache it, and a cached disallow can keep you out of the index long after the site is back up. I have watched a two day robots.txt line turn into a month of missing pages. Use 503.
Q: How long before rankings suffer?
Days of 503 is fine. Weeks is not. I do not know the exact thresholds and Google has not published them. The analogy I use with clients is a shop with a sign on the door: shut for the weekend while you fix the wiring, regulars come back Monday. Boards over the windows for three weeks and they find another shop. Retry-After is the sign telling them when to come back.
If the fix is genuinely in place, stay online. Most boxes I see compromised are patched within a day and never need to go dark at all.
What It Means in Practice
The ordering matters more than the individual commands. Snapshot the box before you touch anything, because if the patch goes sideways you want the filesystem exactly as it was, malware and all, to compare against later. On a cPanel box that is a quick tar of /home/$USER to a location outside the webroot, or an image snapshot if your provider charges by the hour and you can afford one.
Then patch PHP. Not just the one site that got hit, every vhost on the box, because the shared PHP handler is shared.
Then look for what the attacker left behind. The check I run on every compromised box:
find /home/$USER/public_html -name '*.php' -mtime -7 -ls
What you are looking for is timestamps clustered into a few minutes on files that should be old, especially anything under wp-content/uploads, images, or a cache directory. PHP files in an uploads folder are almost never legitimate. When I open them, the first line is usually an eval or base64 blob wrapped in @ to swallow errors. Delete the file, then check whether a cron entry or a modified .htaccess is re-dropping it. Cleaning the shell without cleaning the persistence gets you reinfected inside a day.
Rotate database credentials and the WordPress salts in wp-config.php after that. Existing sessions and any stolen config get cut off.
If you do decide to go dark, set the 503 at the vhost level. In nginx that is a return 503 in the server block; in Apache a rewrite rule. Do not do it from PHP, because the whole reason you are taking the site down is that the application is not trustworthy, and a 503 served by a broken app is a 500 waiting to happen. Add Retry-After: 86400 so crawlers know when to come back.
One thing that trips people up: your Google Business Profile posts and local panel do not disappear during a short 503. They are separate from your site. Do not log in mid-outage and start deleting posts or editing your category out of panic. You will spend the next month undoing it.
What to Expect Next
Public RCE always pulls a second wave. Once an exploit class is documented, scanners get written, and those scanners do not read vendor advisories to check whether you patched. My expectation, based on how previous PHP RCE cycles played out, is two to four weeks of elevated probing against /wp-content/uploads, /xmlrpc.php, and any eval-friendly endpoint someone forgot. Most of it is noise. The hit rate is not zero. If you patched this week you are in the low-effort tier of that scan, which is exactly where you want to be, since attackers move on to the unpatched shelf.
Ranking movement is the other thing to keep in mind. There has been steady volatility chatter through October with no named core update, per this week’s Search News Buzz recap (opens in new tab), and that matters for one narrow reason: if you run a 503 for two days and your positions shuffle the following week, you will be tempted to blame the outage. Traffic swings during unsettled ranking periods are normal. Do not rewrite titles mid-recovery, and do not file a reconsideration request for something that is not a manual action.
On the paid side, two items worth tracking if you advertise. Google Ads expanded financial services verification to the US and Canada, so if you are in lending, insurance, or crypto-adjacent categories, budget a few days of paperwork before your next campaign push. ChatGPT ads is auto-enabling creative enhancements, which means your ad copy may get rewritten by default. Go look at that toggle this week rather than discovering it when a headline reads differently than what you approved.
I do not know how aggressive the post-exploit scanning will get. Historical pattern says it fades in a month. That is a guess from watching previous cycles, not a measurement. Patch now and the guess stops mattering.
Next Step
Before you decide anything about downtime, get a read on your own filesystem. That single check tells you whether this is a patching job or a containment job, and the two have nothing in common.
On every box you own, run this from the docroot:
find . -name '*.php' -mtime -7 -type f -printf '%TY-%Tm-%Td %TH:%TM %p\n' | sort -r | head -50
Read the output like a human. Core files, theme files, and plugin files that changed because you ran updates are expected. A random .php sitting in wp-content/uploads/, /images/, or /tmp/ is not. Neither is a file whose first line is eval(gzinflate(base64_decode(. Widen to -mtime -30 if the box has been up a while and you want a longer tail, and check /home/$USER/public_html explicitly since that is the path shared hosts actually expose.
Add one more pass for the filename tricks, because straight .php misses them:
find . -type f \( -name '*.php*' -o -name '*.phtml' -o -name '*.phar' \) -mtime -14
If that comes back clean, patch PHP and stay online. Update to the current patch release for your branch, restart PHP-FPM, and confirm the version moved with php -v rather than assuming the package manager did what you asked. Then rotate database passwords and the AUTH_KEY/SALT values in wp-config.php, because a shell that ran for an hour has already read them.
If the find turns up something you cannot explain, that is when the 503 comes out. Put it at the vhost level, above the application, so it keeps serving when the app is the thing that is broken. Retry-After: 86400 and a plain HTML body. Then clean, rotate credentials, and only after the files are clean, request a recrawl through Search Console’s URL inspection tool for your key pages.
Do the find today. It is one command and it costs you nothing but the time to read fifty lines of output.