The long-term fix
Nobody Can Exploit PHP on a Site That Does Not Run It: The Next.js Way Out of PHP2Shell
Patching PHP2Shell closes this week's hole. It does not change the arrangement that made the hole matter: a public server that runs PHP for any stranger who sends it a request. A Next.js front end changes the arrangement, and your editors can keep WordPress while it happens.
October 23, 2026 · 10 min read
The short answer
A Next.js site pre-renders its pages to HTML and serves them from an edge network, so the public server runs no PHP for PHP2Shell to attack. The fast path keeps WordPress as a private, headless content source behind Next.js. The full move replaces WordPress with Athena CMS, with no PHP anywhere. Patch first, then move.
On this page
- The attack needs a stranger, a POST request and PHP
- The fast path: WordPress stays, PHP leaves the front door
- The full move: no PHP to patch, ever
- Three setups, side by side
- Your rankings, URLs and content come along
- Next.js is not a force field
- Patch today. Rebuild after.
- Prices, financing and a free first look
The attack needs a stranger, a POST request and PHP
Strip PHP2Shell to its working parts and three things must meet. An anonymous visitor sends a request, usually a POST with a multipart upload. A public web server hands that request to PHP. PHP, on an affected version, mishandles memory while parsing it, and under the right conditions the attacker's code runs. Wiz Research showed this against the official Docker images of WordPress, Drupal and Joomla. The application on top barely matters; Wiz says even a "Hello World" page on an affected PHP version can be exposed.
The patch breaks the third link. That is the right move today, and our emergency fix does it. But the second link is a choice, and most small business sites made it years ago without noticing: every page view runs PHP on a public machine. Take that link away and the next PHP flaw, whatever it is called, finds no interpreter on the other end of the wire.
The safest PHP on the internet is the PHP the internet cannot reach.
The fast path: WordPress stays, PHP leaves the front door
This is the easy integration, and it is easy for a specific reason: nothing your editors do has to change. We build a Next.js front end that reads your WordPress content through its REST or GraphQL API, pre-renders every page to plain HTML and serves it from Vercel's global edge network. Visitors get HTML. They never touch WordPress.
WordPress then moves behind the curtain as a private, headless content source. The admin sits behind a login allowlist or a VPN. No PHP endpoint answers the public internet. Your team still logs into the same dashboard, writes the same posts and presses the same Publish button, and the page updates on the public site. Your content, your URLs and your redirects come with it.
A typical PHP site
A visitor, or an attacker
Every request goes straight to the server.
Public web server running PHP
PHP2Shell lives here. An anonymous POST reaches the interpreter.
Database and secrets
Within reach of whatever runs on that server.
A Next.js site
A visitor, or an attacker
Requests stop at the edge network.
Pre-rendered pages on an edge network
Plain HTML, built ahead of time. No PHP runtime to talk to.
Private content system
WordPress behind a lock, or Athena CMS. Read at build time, not open to the public.
One thing does not change, and we will not pretend otherwise: the private WordPress still runs PHP, so it still gets patched. The difference is who can reach it. PHP2Shell needs an anonymous POST request to arrive at PHP. A server that answers only your editors and your front end does not take requests from strangers. The mechanics, including previews and plugins that stop drawing on the page, are in our guide to keeping WordPress as your CMS.
The full move: no PHP to patch, ever
The fast path leaves you running two systems. Some organizations want that, because their editors live in WordPress and a migration of habits costs more than a server. Many small businesses do not, and for them the cleaner answer is to retire WordPress. We replace it with Athena CMS, the content system we built and include with every custom site we make. Athena has no PHP in it anywhere.
Your pages, posts, products and images move into plain fields with a live preview, and every version is kept. The features that used to be plugins become part of the build. There is no plugin update to apply on a Friday afternoon, and no PHP release to wait for from your host. The move itself is described step by step at switching from WordPress to Athena, and the head-to-head is at Athena vs WordPress.

Three setups, side by side
Here is how a patched WordPress site compares with the two ways out. The first column is not a straw man: a WordPress site on PHP 8.4.27 is a perfectly respectable thing to own this week. The question is what owning it costs you the next time.
| WordPress today, patched | Fast path: Next.js + private WordPress | Full move: Next.js + Athena CMS | |
|---|---|---|---|
| Can a stranger's request reach PHP | Yes, on the public server | No; WordPress answers only editors and the front end | No; there is no PHP |
| What an attacker can talk to | PHP, the login page, plugin endpoints and any PHP file the server will run | Pre-rendered HTML, plus any forms or APIs the site runs | The same, plus Athena's sign-in for editors |
| Patching burden | PHP, WordPress core, theme and plugins, applied to the live site | The same back-end patching, now off the public path, plus Next.js updates | Next.js and its packages, tested before each deploy |
| Speed for visitors | Depends on the host, caching and every plugin's scripts | Pages pre-rendered and served from the edge | Same as the fast path |
| Editing | The WordPress dashboard | The same dashboard; page-builder layouts are rebuilt in Next.js | Plain fields, live preview, every version kept |
| Systems to run | One | Two: WordPress and the front end | One |
| What it costs | What you pay today, plus every emergency | A fixed-price build from $1,750, plus private WordPress hosting | A fixed-price build from $1,750; $3,500 and up with a store, portal or web app |
The first row is the whole security argument in one line. The longer version, row by row, is on our WordPress vs Next.js security page, and the fair case for each back end is in headless WordPress vs Next.js.
Your rankings, URLs and content come along
The objection that stops most owners is not the price. It is the fear of losing years of search rankings in a weekend. That fear is reasonable and the loss is avoidable. We keep your URLs and redirect every old one. Nothing is left to chance or to a plugin's default settings.
- Content. Every page, post, product, image and author carries over. On the fast path it never moves at all; Next.js reads it where it already lives.
- URLs. Addresses stay the same wherever possible, and every one that changes gets a permanent redirect, mapped one by one. Our redirect guide shows how.
- Search signals. Titles, descriptions, canonical tags and structured data are written into the new pages, not regenerated by guesswork. See migrating without losing SEO.
- Forms and integrations. Each form, booking widget and email hookup is listed during the audit and rebuilt in the new site, so nothing quietly stops sending leads.
- Plugins. Each plugin's job is written down and either built in, replaced or retired. A few turn out to do nothing but load; the full accounting is in WordPress plugins vs Next.js.
Next.js is not a force field
A sales page that claims invulnerability is a page you should close. So here are the limits, stated plainly. Moving off PHP removes this class of bug. It does not make a site immune to every other kind.
Next.js has had serious advisories of its own. In December 2025 the Next.js team published CVE-2025-66478, rated CVSS 10.0: a flaw in React Server Components that could allow remote code execution in unpatched App Router applications. It was nicknamed React2Shell, which tells you the security industry has found a naming convention it likes. The fix then was the same as the fix now: update.
Those updates are the job of our hosting and maintenance plans, which cover tested updates, off-server backups, security and uptime monitoring, with no long contract. The difference is that an update to a Next.js site is built and checked before it goes live, instead of applied to the live server and hoped about.
Patch today. Rebuild after.
A rebuild is not an emergency response, and we will not sell it as one. Your current site has to be safe while the new one is being made, so the order never varies. Nobody is left on a vulnerable PHP version while a designer chooses fonts.
- 1
Patch the current site
PHP goes to 8.2.35, 8.3.36, 8.4.27 or 8.5.12, the site is tested and checked for signs of compromise. That is the emergency fix, and it comes first.
- 2
Audit what you have
Every URL, form, plugin, integration and content type, written down, with a fixed-price quote for the fast path, the full move or both.
- 3
Build on a preview address
The new front end, with private WordPress or with Athena, is built and compared page by page while the patched site keeps working.
- 4
Switch and lock down
DNS moves, redirects go live, and WordPress is either closed to the public or retired. Search Console is watched for crawl errors afterward.
If your current site runs PHP 8.1 or older, step one is harder, because the PHP project ships no release for those versions. Our end-of-life PHP guide covers the stopgaps, and for many of those sites the rebuild is simply the cheaper way out.
Prices, financing and a free first look
Custom builds and rebuilds are a fixed price starting at $1,750. Sites with a store, a customer portal or a web app start at $3,500. We quote after a free audit, so the number reflects your site and not a guess. Financing is available for websites and for WordPress projects, and the broader menu is on our web design pricing page.
Free mockup
We design your new home page and send it, no obligation. The free mockup is the cheapest way to see what the move would look like.
Free audit
Start with a free site audit of what you run today. We follow it with a fixed price for each path.
Rebuild service
The full scope, from content mapping to launch, is on our WordPress to Next.js rebuild and replacing WordPress pages.
Still deciding whether to leave at all? Should I leave WordPress makes the case for staying, too. Or call (210) 346-0848. We are in San Antonio, Texas, and work with businesses across the US. The PHP2Shell hub has everything else about this week.
Questions owners ask about PHP2Shell
Not by PHP2Shell itself. The flaw lives in the PHP interpreter, and a Next.js site serves pre-rendered HTML with no PHP runtime on the public server. If the site uses WordPress as a private, headless back end, that WordPress server still runs PHP and still needs patching, but it no longer accepts the anonymous requests the attack depends on.
Yes. That is the fast path: a Next.js front end serves every public page, and WordPress becomes a private content source with its admin behind a login allowlist or VPN. Editors keep the same dashboard. Builder layouts and front-end plugin features are rebuilt in Next.js. The details are in keeping WordPress as your CMS.
Custom builds and rebuilds are a fixed price starting at $1,750, and sites with a store, portal or web app start at $3,500. We quote after a free audit. Financing is available through website financing. The fast path also keeps a private WordPress install, so its hosting continues; the full move to Athena CMS does not.
Not if the move is done carefully. We keep your URLs and redirect every old one, carry over titles, descriptions and structured data, and watch Search Console after the switch. On the fast path the content never moves at all. The method is laid out in migrating without losing SEO.
Patch first, always. A rebuild takes longer than an unpatched server should be left alone, so the current site goes to a fixed PHP release, gets tested and gets checked for signs of compromise before any new work starts. Our emergency fix handles that step at a fixed price for WordPress sites.
A pre-rendered Next.js site exposes far less to a stranger: no public PHP, no plugin endpoints, no WordPress login on the public site. It is not invulnerable. Next.js has had critical advisories of its own, including CVE-2025-66478 in December 2025, and any server code still needs updates. Fewer moving parts in public means fewer things to break into.
Keep reading
- Emergency servicePHP2Shell Emergency Fix: We Patch Your PHP, Test the Site and Check for IntrudersWe update PHP to a fixed release, test every page, check for signs of a break-in and clean up if needed. WordPress fixes from $249, paid on the page.
- CMS owners' briefingPHP2Shell on WordPress, Drupal and Joomla: Your CMS Is Current. Is Your PHP?Why a fully updated WordPress, Drupal or Joomla site can still fall to PHP2Shell, why security plugins cannot fix it, and what to update first.
- Incident checkPHP2Shell Signs of Compromise: How to Tell Whether Anyone Got InThe published warning signs of a PHP2Shell attack, where to find them in logs and files, and what to do if you find one: evidence, new keys, a clean rebuild.
- Unsupported versionsEnd-of-Life PHP and PHP2Shell: What to Do When No Fix Is ComingPHP 8.1 and older get no PHP2Shell release. What the PHP project offers instead, how distribution backports work, and the three ways off old PHP.
- Check your exposureAm I Affected by PHP2Shell? Find Your PHP Version and Read the ResultFive ways to find the PHP version and SAPI behind your site, a table that turns the number into a next step, and which sites PHP2Shell cannot touch.
- Shared hostingPatching PHP2Shell on Shared Hosting: cPanel, Plesk and Managed WordPressOn shared hosting your host patches PHP for PHP2Shell. How to confirm it in cPanel or Plesk, what to ask for in writing, and what breaks on newer PHP.
- Everything in PHP2ShellSee the section
See your site without PHP in front
Tell us what you run today. We will confirm it is patched or patch it, then show you the fast path and the full move with a fixed price for each.
Which of these sounds like you? (pick any)
Rather talk now? Call (210) 346-0848.