WordPress is incredibly useful. It provides content management, themes, plugins, user permissions and a familiar editing experience, all without requiring someone to write code every time a page needs updating. But what happens when you have a relatively small WordPress website that rarely changes? Do you really need PHP, a database, a collection of plugins and a traditional hosting environment just to display a handful of pages? I wanted to explore that question with a practical experiment: could I take an existing WordPress website, export it automatically and host it as a static website on Cloudflare Pages — without rebuilding the entire frontend?
The results were surprisingly good. The experiment wasn't completely straightforward, and it exposed some important disadvantages of moving away from a CMS. But it also demonstrated that migrating an existing website to static hosting doesn't necessarily require starting again.
The Starting Point
The test website was a relatively small, public-facing WordPress website. It had a custom theme, responsive navigation, several content pages, images, JavaScript functionality, a translation widget and SEO features provided by WordPress plugins. It wasn't a complex web application. There were no essential user accounts, shopping baskets or personalised dashboards. Most of its functionality involved displaying content. That made it an interesting candidate for static hosting.
The aim was to preserve the existing website's appearance and functionality while removing the need for WordPress to run on the public-facing hosting environment. I also wanted the process to be repeatable. Manually copying the HTML from every page would have proved very little.
Attempt One: Mirroring the Website with HTTrack
My first approach was to use HTTrack, a website mirroring tool that downloads web pages and their associated resources for offline use. On paper, it seemed ideal. Point the tool at the website, let it download the pages, and publish the resulting files somewhere else.
Unfortunately, the results weren't quite that simple. The mirrored website contained broken asset paths, missing resources and JavaScript errors. Some functionality depended on scripts and dynamically generated markup that didn't survive the mirroring process cleanly.
One particularly troublesome issue involved Webpack modules failing to load correctly. It became apparent that I could spend a considerable amount of time repairing the mirror without having a reliable way to reproduce those repairs.
The lesson: downloading a website isn't necessarily the same as capturing a working version of it. For modern websites, what the server returns and what the browser eventually displays can be two different things.
Attempt Two: Let the Browser Do the Work
The next approach was much more successful. Instead of downloading raw pages and hoping they worked, I used a real browser to visit the existing website and capture its rendered output. The main tools were:
Node.js to run the export process.
Playwright to automate a browser and capture rendered pages.
Cheerio to inspect and manipulate HTML.
Playwright was particularly useful because it allowed the export process to work with the page after browser-side JavaScript had run. Cheerio then provided a convenient way to process the resulting HTML and adjust references where necessary. The basic idea was:
Visit the website → discover pages → render them → capture HTML → download assets → rewrite paths → save static files.
The exporter could be run from the command line:
node wp-static-exporter.mjs https://example.com/Rather than creating a new website design, this process reused the existing one.
The First Export
The initial export reported:
Metric | Result |
|---|---|
Pages exported | 17 |
Assets captured | 130 |
Reported failures or warnings | 16 |
Some failures involved filesystem path conflicts. Others related to external resources such as Google Fonts and YouTube. At first, those numbers didn't look particularly encouraging. However, the important test was whether the exported website actually worked. I started a local server using:
npx serve dist -l 3000And opened the website in a browser. To my surprise, the homepage looked almost identical to the original. Most navigation links worked, the CSS loaded, and the majority of the JavaScript functionality was intact. There were problems to fix, but the core experiment had succeeded.
The Problems That Still Needed Fixing
A static export can capture an impressive amount of an existing website, but it also captures some of the assumptions that the original website made about its environment. A few issues stood out.
JavaScript-generated components
The website included a translation widget. The static export initially displayed two translation buttons instead of one. After inspecting the HTML, I discovered that the export had captured markup generated by the widget, while the widget's JavaScript was also creating a new instance when the static page loaded. The solution was to remove the duplicated generated markup without removing the JavaScript needed for translation.
This was a useful reminder that capturing the final rendered DOM isn't always the same as capturing the ideal starting HTML.
Some elements should be generated by JavaScript when the page loads, rather than saved permanently into the exported page.
Missing plugin assets
The translation widget also referenced SVG language flags that hadn't been included in the initial export. Because the original WordPress source files were available, I could locate the missing assets and copy them into the static website. This fixed the display without requiring the original plugin to run on the server.
CSS and resource paths
A handful of CSS declarations and asset references needed correcting. These included malformed URLs and missing characters in some CSS rules. Fortunately, there weren't many. The experience reinforced the value of browser developer tools and automated link checking when validating a static export.
External resources
Some third-party resources, particularly YouTube-related files, produced very long directory paths. This caused problems when copying files on Windows and introduced warnings when preparing the Git repository. In a more mature export process, I would avoid mirroring unnecessary third-party JavaScript and instead allow supported embeds to load directly from their providers.
Publishing the Website with GitHub and Cloudflare Pages
Once the local version was working, the next step was deployment. I created a separate GitHub repository containing the static website files and connected it to Cloudflare Pages. Because the site was already exported as HTML, CSS, JavaScript and assets, Cloudflare didn't need to compile a frontend application. The deployment configuration was deliberately simple:
Framework preset: None
Build command: Empty
Output directory: Repository root
Production branch:
main
After the initial deployment, the website was available through a Cloudflare pages.dev address. The workflow became:
Edit locally → Commit changes → Push to GitHub → Cloudflare deploys automatically.
Cloudflare Pages also supports preview deployments, which can be useful for reviewing changes before they reach production. Cloudflare's Git integration documentation explains how this works. This was one of the most satisfying parts of the experiment: the website was now running independently of WordPress, with deployment managed through Git.
What About SEO, Sitemaps and 404 Pages?
WordPress and SEO plugins quietly handle quite a few things that are easy to overlook until they're gone. For example, the original website used dynamically generated XML sitemaps. On a static website, there's no PHP application generating those responses.
Instead, I created a simple sitemap.xml containing the known public page URLs. I also added a static robots.txt file and prepared a custom 404.html page by reusing the website's existing header, footer and styling. There were a couple of XML formatting issues along the way, including a missing closing tag, but these were straightforward to identify and correct. This highlighted an important distinction:
Removing a CMS doesn't remove the responsibilities that the CMS was handling.
It simply moves those responsibilities somewhere else. Sitemaps, redirects, metadata, accessibility, error handling and content updates still need to be managed. They may become simpler, but they don't disappear.
The Benefits of Removing WordPress
For the right kind of website, the advantages are compelling.
1. Simpler hosting
A static website doesn't need a PHP runtime or a database to serve its pages. That means fewer moving parts in the public hosting environment. There are no database connections to maintain for normal page delivery, and no WordPress application process needs to run for every request.
2. A smaller server-side attack surface
WordPress is a mature platform, but running it involves maintaining the application, themes, plugins and hosting environment. A static website removes many server-side components that could otherwise become security risks. That doesn't make static sites automatically secure. Frontend dependencies, external services, access controls and deployment credentials still need attention. But it does simplify the public-facing architecture.
3. Potential performance improvements
Static HTML and assets can be delivered efficiently through a content delivery network. There is no need to generate each page dynamically from a database during a normal request. The result can be faster and more predictable, although actual improvements depend on factors such as image sizes, JavaScript, caching and network conditions. Performance should be measured rather than assumed.
4. Version-controlled deployments
With GitHub and Cloudflare Pages, website changes can be tracked through commits. This makes it easier to review changes, identify when something broke and restore an earlier version. It also provides a more structured deployment process than manually uploading files.
5. Potentially lower operational overhead
For a small website that rarely changes, static hosting can reduce the number of services that need to be maintained. Depending on traffic and hosting requirements, it may also reduce costs. However, hosting cost is only one part of the equation. Developer time can easily outweigh any infrastructure savings.
The Disadvantages of Not Having a CMS
This is where the comparison becomes more interesting. A static website isn't automatically the better choice. In fact, for many organisations, removing the CMS could make day-to-day website management significantly worse.
1. Every content change becomes a development task
This is probably the biggest disadvantage. With WordPress, an authorised content editor can log in, update a paragraph, replace an image or publish a new page. With a plain static website, someone generally needs to edit the source files, commit the changes and deploy them. Even a small text correction may require developer involvement. That introduces delays, creates dependencies and potentially increases the cost of routine content maintenance. A Git-based deployment process is convenient for developers, but it isn't necessarily convenient for content editors.
2. There's no built-in editing interface
WordPress provides a visual editing environment, media management, drafts and publishing tools. A basic static export provides none of those things. Without additional tooling, editors may need to work directly with HTML, Markdown or other source files. For non-technical teams, that can be a substantial step backwards.
3. Publishing workflows need replacing
Content management systems can provide user roles, draft content, scheduled publishing and editorial review processes. A static site may require additional tools or custom workflows to achieve the same capabilities. Git pull requests can provide excellent technical review, but they aren't always a suitable replacement for an editorial workflow.
4. Dynamic functionality becomes more complicated
Contact forms, site search, personalised content, user authentication and other dynamic features need somewhere to run. On a static site, these features may require external services, APIs or serverless functions. That can be perfectly reasonable, but it introduces additional architectural decisions. A website that relies heavily on dynamic functionality may not benefit from a straightforward static export.
5. Regenerating the site can introduce problems
In this experiment, several issues were fixed manually after the initial export. If the entire website were exported again, those fixes could be lost unless they were incorporated into the export process. A repeatable migration needs more than a script that downloads pages. It also needs reliable transformations, validation and testing.
6. Content ownership can shift to the development team
This is a less obvious organisational issue. A CMS allows content teams to own much of the publishing process. Removing it can move that responsibility back to developers. That may be acceptable for a small, rarely updated site, but it can become a bottleneck for a busy organisation.
CMS vs Static Hosting: Which Is Better?
Neither approach wins in every situation.
Consideration | WordPress CMS | Plain static website |
|---|---|---|
Content editing | Accessible to non-developers | Usually requires technical changes |
Publishing | Through CMS interface | Typically requires a deployment |
Hosting | Application and database infrastructure | Static files and CDN |
Plugin functionality | Large ecosystem | May require custom integrations |
Maintenance | Core, theme and plugin updates | Build tools, dependencies and assets |
Security | More server-side components to maintain | Smaller server-side attack surface |
Performance | Can be excellent with optimisation | Often simpler to cache and serve |
Version control | Depends on workflow and configuration | Natural fit for Git |
Editorial workflows | Built-in or plugin-supported | Requires additional tooling |
Best suited to | Frequently updated, editor-managed sites | Relatively stable, developer-managed sites |
The deciding factor isn't simply performance or hosting cost. It's how the website is used, who maintains it and how frequently its content changes.
For a website updated several times a week by non-technical colleagues, WordPress may be the better solution. For a small information website that changes a few times a year, static hosting could be much simpler.
Is There a Middle Ground?
Absolutely. The choice doesn't have to be between a traditional WordPress installation and developers manually editing HTML. There are several alternatives.
Static site generators
Frameworks such as Astro and Eleventy allow websites to be built using reusable templates, layouts and components. This can solve problems such as duplicated CSS, headers and footers while still producing static HTML.
Headless content management
A headless CMS separates content editing from website delivery. Editors continue using a content interface, while the frontend can be built and deployed as a static site. This can offer a useful compromise between editorial independence and static hosting. It does, however, introduce additional infrastructure and integration work.
Git-based content management
Tools such as Decap CMS provide editing interfaces for content stored in Git repositories. This can make a static website more accessible to non-developers without introducing a traditional database-driven CMS. The suitability of this approach depends on the content model and editorial requirements.
What I'd Improve Next
Although the experiment produced a working website, the output could be improved considerably. One obvious issue is duplicated CSS. The original website's generated styles are included across multiple exported pages. Extracting common styles into a shared stylesheet could reduce duplication and improve caching.
The same principle applies to the navigation and footer. Rather than maintaining copies of those elements in every page, they could be stored as reusable templates and inserted during a build process.
I'd also improve the exporter to handle the issues encountered during testing automatically. That would include removing duplicated JavaScript-generated markup, copying missing assets, validating CSS and links, generating the sitemap and checking the final output. The goal would be to turn the experiment into a reliable, repeatable pipeline:
Export → Clean → Optimise → Validate → Deploy.
At that point, the process could become useful for other small websites with similar requirements.
Final Thoughts
This experiment began with a simple question:
Could an existing WordPress website be moved to static hosting without rebuilding it?
The answer, at least for this particular test site, was yes. Using Node.js, Playwright and Cheerio, I was able to capture the rendered website, preserve most of its functionality, resolve a handful of issues and publish the result through GitHub and Cloudflare Pages. The final website looked remarkably close to the original. But the experiment also reinforced something important: a CMS isn't just a technology choice. It's a content management workflow.
Removing WordPress may simplify hosting, improve the deployment model and reduce server-side complexity. It can also make routine content changes harder, increase dependence on developers and remove tools that editorial teams rely on. For a relatively stable brochure website, those trade-offs might be worthwhile. For a frequently updated website managed by a non-technical team, keeping a CMS — or introducing a headless alternative — may be the more sensible option.
The most interesting outcome wasn't simply that the static version worked. It was discovering how much of an existing website could be preserved through automation, and how little manual rebuilding was actually necessary. Sometimes modernising a website doesn't mean rebuilding everything. Sometimes it means changing how the existing website is delivered.
Further Reading
Node.js — JavaScript runtime used for the exporter.
Playwright — Browser automation and testing.
Cheerio — HTML parsing and manipulation.
HTTrack — Website mirroring software.
Cloudflare Pages documentation — Static hosting and deployments.
Cloudflare Pages Git integration — Automatic deployment from Git.
WordPress documentation — WordPress content management and administration.
Astro — Framework for content-focused websites.
Eleventy — Static site generator.
Decap CMS — Git-based content management.