PHP2Shell: How to Patch Your Website Without Losing Google Rankings
On 21 October 2026 the PHP project released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 to fix two critical flaws that can let attackers run code on a server without logging in, and it told every PHP user to update immediately. If your site needs to go offline for the patch, Google’s advice is to return a 503 status for a few hours, not a timeout, a 404 or a 500.
Here is what the flaw is, how many sites it touches, which server response protects your rankings, and the seven steps for a maintenance window Google respects.
What is PHP2Shell, and who has to patch?
On 21 October 2026 the PHP project published a security advisory with an unusually direct headline: critical remote code execution vulnerabilities, update now. PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two flaws that can let an attacker run code on a server without logging in. The industry has been calling the pair PHP2Shell.
The two flaws are tracked as CVE-2026-109618, where out-of-memory handling can leave request data half-initialized, and CVE-2026-109619, where internal state from one request survives into the next after its memory has been freed. The PHP project’s GitHub advisories rate both Critical, 9.2 out of 10 on CVSS version 4.
The advisory says who is at risk: all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. It considers the risk highest for mod_php, where it has a demonstrated exploit that fires before any application code runs. In plain terms, if your website runs on WordPress or any other PHP software, this applies to you, whether or not you have ever touched a line of code.
How many websites does this touch?
A lot. W3Techs, which surveys the technology behind the web, reported on 24 October 2026 that PHP is used by 69.3% of websites whose server-side language it can identify, and that WordPress alone runs 39.6% of all websites. Most of the small-business sites we see in Miami and Mexico City, from real estate offices to clinics and restaurants, sit in that group.
The more worrying number is about old versions. WordPress.org publishes the PHP versions reported by WordPress sites. On 24 October 2026, 34.2% of those sites were on PHP 8.1 or older, and PHP 7.4 alone accounted for 15.3%. The PHP project says 8.1 and older no longer receive its updates. It made an exception this time and published minimal source fixes for 7.4, 8.0 and 8.1, but those are for people who build PHP themselves, not for a typical hosting plan.
So the question for most owners is not whether they are affected. It is whether their host has already updated, and whether the site is running a version anyone still patches.
Should you take your site offline to patch?
Usually not. Most hosts can update PHP with a restart and no visible downtime. But some organizations chose to take sites down until the patch was in place, and if your host or developer needs a maintenance window, the way you take the site down decides whether Google notices.
Google’s own guide to pausing a website is blunt about the stakes. It calls disabling a whole site an extreme measure for “a very short period of time (a few days at most)”, and warns that a complete removal from the index can take a long time to recover from, with no way to speed it up. The good news is that a few hours of correctly signalled downtime is exactly the case Google’s systems are built to handle.
On the same day as the advisory, Google’s John Mueller posted on Bluesky that site owners taking PHP sites down should “use HTTP 503 instead of letting responses time out / 404 / 500.” He added that this can be done outside PHP, by pointing DNS elsewhere or at the CDN.
Which response keeps your rankings safe?
The difference comes down to one number the server sends back. Here is what Google’s documentation says each choice tells its crawler.
| What the server returns | What Google reads | Use it? |
|---|---|---|
| 503 Service Unavailable, with Retry-After | Temporary downtime; come back later | Yes, for hours up to 1–2 days |
| 200 with an indexable placeholder home page | A live page with a status message | Yes, if the outage runs longer |
| 404, 410 or 403 | The page is gone; URLs get removed | No |
| noindex tag or header | Remove this page from Search | No |
| robots.txt that disallows everything | Stop crawling; content may be dropped | No |
| Timeouts or 500 errors | A broken server, not a planned pause | Avoid |
Two details catch people out. Google says not to return a 503 for the robots.txt file itself, because that blocks all crawling. And its 2011 guidance, still linked from the current docs, notes that a 503 left in place for too long can eventually be read as a permanent outage, with URLs removed. A 503 is a pause button, not a parking spot.
How to set up a maintenance page Google respects
If your developer or host needs a window, this is the order we would follow, built from Google’s best practices for disabling a site.
- Serve the page from outside PHP. A static HTML file from the web server, the CDN or a second server. A PHP-generated maintenance page needs the very thing you are fixing.
- Return status 503 on every page except robots.txt. robots.txt keeps answering 200 with its normal rules.
- Add a Retry-After header with your best estimate, as a date or a number of seconds.
- Keep the page light. Inline CSS, no external scripts, and a short message saying when the site will be back and how to reach you.
- Test it from outside. Google suggests a command such as
curl -Ito confirm the response really says 503. - Do not touch Search Console’s removal tool. Google says it is the wrong tool for closures.
- When you are back, check a few key pages return 200 and ask Search Console to recrawl the home page.
One trade-off to know: while a page returns 503, Google says it cannot refresh that page’s titles, descriptions or structured data. Keep the window as short as the work allows. If you want to know how long Google typically takes to pick changes back up, we covered it in how long Google takes to index a page.
What if your host cannot update today?
The PHP advisory lists temporary measures, and it is careful to say they reduce exposure to specific attack paths but do not make an installation safe. Only the update fixes it. The main ones, which your host or developer would apply in the server configuration:
- Set
session.upload_progress.enabled=0and restart every PHP worker. On 23 October the PHP project repeated this advice for a third, less likely issue (CVE-2026-115560), to stay in place until its next regular release. - Lower
post_max_size: 8M for sites without file uploads, 32M if uploads are needed. - Enforce request-size and header limits at the web server or proxy.
- On PHP 8.5, set
fatal_error_backtraces=0.
The advisory notes that settings changed with ini_set() or a .user.ini file do not count; they have to apply before the request is parsed. If you are on shared hosting and cannot edit server settings, the right move is a direct question to your host: which PHP version is my site on right now, and when was it patched?
Old PHP is now the bigger risk
The emergency patch will be applied quickly by most hosts. The longer problem is the third of WordPress sites on versions the PHP project has stopped maintaining. The one-off backports for 7.4 to 8.1 were a courtesy for this incident, not a promise for the next one.
The calendar matters too. The PHP project’s supported-versions page shows security support for 8.2 ending on 31 December 2026, about ten weeks from now. A site that was just patched to 8.2.35 has bought itself a little over two months before it is back on an unsupported branch. If your site is on 8.2 or older, plan the move to 8.3 or newer now, with a test copy first, because older plugins and themes are what usually break.
Why downtime also costs you in AI answers
A site that goes dark is not only missing from Google’s blue links. In our view, it is also missing from the pages AI assistants read and quote when someone asks for a recommendation. A hacked site is worse: injected spam or redirects can sit on a page for weeks before anyone notices, and that is the version crawlers see.
That is why we treat security updates as part of generative engine optimization, not a separate IT chore. If you want a quick read on how machines see your site today, the free AI Visibility Checker takes about a minute, and the background on how AI answers use search results is in our guide to AI Overviews and AI Mode.
How we handle it for sites we host
For clients on our managed website hosting, updates like this one are our job, not theirs. The order we follow for an emergency PHP release: confirm the patched version is available from the host, check each site’s current PHP version, apply the update in the lowest-traffic hour, and if a window is needed, put up a static 503 page with a Retry-After header and robots.txt left alone. Then we check the live site from outside, not from the server, and log the version and time in the client file.
If someone else hosts your site, you can ask them the same questions. If you do not know who hosts it, that is the first thing to find out this week.
Want your business found on Google and in ChatGPT? Ciao Bella engagements start at $5,000 a month, no setup fee. See how we work.
Verified 24 October 2026 against the PHP project’s 21 and 23 October 2026 advisories and supported-versions page, its two GitHub security advisories, Google Search Central’s guide to pausing a website and its planned-downtime post, John Mueller’s 21 October Bluesky post, W3Techs usage surveys and WordPress.org PHP version statistics
Building on the web since 1999 · South Florida and Mexico City
Frequently asked questions
Will a few hours offline hurt my Google rankings?
Not if the site returns a 503 status with a Retry-After header for that time. Google’s documentation treats a short 503 as temporary downtime. Timeouts, 404s and 500s are the responses to avoid, and Google says to keep any full closure to a few days at most.
Is my WordPress site affected by PHP2Shell?
If it runs on PHP, and every WordPress site does, it is affected until the server runs PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or a vendor-patched build. Ask your host which version your site is on and when it was updated.
Which PHP versions fix the vulnerabilities?
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released on 21 October 2026. PHP 8.1 and older no longer receive updates from the PHP project; it published minimal source backports for 7.4, 8.0 and 8.1 for this incident only.
Can I just block Google in robots.txt while I patch?
No. Google says a robots.txt that disallows all crawling may remove your content and URLs from Search, and that robots.txt itself should never return a 503. Leave robots.txt as it is and return 503 on the other pages.
How long can a site safely return a 503?
Google’s guide suggests a 503 for urgent closures of one to two days. For anything longer it recommends an indexable placeholder home page that returns 200, and it warns that a 503 left in place too long can lead to URLs being removed.
Sources
- PHP — Security advisory: Critical remote code execution vulnerabilities, update now (21 October 2026) Fixed versions, who is at risk, CVE-2026-109618 and CVE-2026-109619, backports for 7.4 to 8.1, temporary mitigations; 23 October informational advisory on session upload progress (CVE-2026-115560).
- PHP on GitHub — GHSA-w8hw-w9fx-j79w (RCE via OOM corruption) Severity Critical, CVSS v4 9.2; affected and patched versions.
- PHP on GitHub — GHSA-6wmf-4rv5-p3rp (RCE via stale global state) Severity Critical, CVSS v4 9.2; use-after-free mechanism.
- PHP — Supported versions Security support for PHP 8.2 ends 31 December 2026; 8.3 to 31 December 2027.
- Google Search Central — Temporarily pause or disable a website 503 for 1–2 days, 200 placeholder for longer, robots.txt rules, Retry-After, static HTML, what not to use, no refresh of metadata during 503.
- Google Search Central Blog — How to deal with planned site downtime Lasting 503s can lead to URL removal; separate server to return the 503.
- John Mueller on Bluesky (21 October 2026) Use HTTP 503 rather than timeouts, 404 or 500 when taking PHP sites down; can be done outside PHP, via DNS or CDN.
- W3Techs — Usage statistics of PHP and of WordPress (24 October 2026) PHP 69.3% of websites with a known server-side language; WordPress 39.6% of all websites (w3techs.com/technologies/details/cm-wordpress).
- WordPress.org — PHP versions in use Data from api.wordpress.org/stats/php/1.0/, read 24 October 2026: 34.2% on PHP 8.1 or older, 15.3% on 7.4.