After the PHP flaw, WordPress sites replaced by their static copy
We copied the sites page by page, compared the copy with the original, then changed the DNS.
Andrew · Founder, project directorOn 21 October, PHP released fixes for two flaws, CVE-2026-109618 and CVE-2026-109619, which the press named PHP2Shell. They allow code to be run on the server without logging in. The flaw is in the PHP engine itself: PHP has to be updated, and versions 8.1 and older will get no fix. Exploitation attempts had been reported as early as 17 October, before the announcement.
How we handled the affected sites is told in another article. Here we talk about 3 specific sites: www.heytom.io, the website of HeyTom, the QR-code ordering product for hotels and restaurants, and 2 other showcase sites running on WordPress.
Why a static copy
The sites ran on WordPress 5.9, a 2022 version, with Elementor, Slider Revolution and Contact Form 7. Updating PHP meant updating WordPress, the theme and every plugin, and any of them could break the layout.
These sites were almost never changed. None of them has a real blog. So we chose to make a static copy in HTML and CSS pages, served by Cloudflare Pages, until a lasting solution is in place.
We decided to use Claude Code for these operations. From then on, everything was done in agentic mode, with no human coding.
Copying the site
The list of pages comes from the sitemaps. wget downloads each page with its images, stylesheets and scripts. Some files are always missing: a script completes the copy with what wget does not see.
- Elementor background images, declared in JSON.
- Scripts that Elementor loads only when needed.
- Images referenced only in sharing tags. The first acceptance test found eight that were missing.
- The sitemaps,
robots.txtand the error page.
Public addresses stay the same. WordPress redirects are reproduced (/sitemap.xml to /sitemap_index.xml, for example), as well as the HSTS header. WordPress-specific links (xmlrpc, wp-json, emoji) are removed.
Two differences were accepted: addresses without a trailing slash are redirected with a 308 instead of a 301, as Cloudflare Pages does, and RSS feeds return 404.
The contact form
This is the only part that needs a server. Contact Form 7 is replaced by a small function on Cloudflare Pages. It checks with Turnstile that the submission is not from a bot, then sends the message through Brevo. The fields and error messages are those of the original form.
On heytom.io, each submission is also saved in a database.
Comparing the copy with the original
Before each switch, a script compares every page of the copy with the live page: title, description, robots tags, canonical address, sharing tags, language versions and links.
Claude Code tested on its own in a browser, at desktop and phone widths, looking for JavaScript errors, missing files and broken images.
The switches
Each switch had its rollback written before starting.
With the DNS at Gandi, changing the www name to Cloudflare Pages took a few minutes.
As long as WordPress runs on the old server, it can still be reached through that server’s IP address, and the flaw is not closed. It is therefore very important to stop the services and decommission the machines.
Where we are
AI let us handle 3 sites in parallel in a few days:
- rebuild the sites entirely, identical to the originals;
- test every page automatically;
- get the dynamic parts working (forms, saving to a database).
Two of the three sites are already served as static pages, and www.heytom.io switches over on Saturday. We will then have time to put a lasting solution in place, with no loss of service.