# How to Convert WordPress to a Static Website

> A step-by-step guide to moving a WordPress site to a static website: inventory, export, templates, URLs and redirects, forms and search, verification and launch.

- URL: https://nofpress.com/blog/wordpress-to-static/
- Language: en
- Published: 2026-10-23
- Author: Paweł Szmidt
- Other languages: [Polski](https://nofpress.pl/blog/wordpress-na-strone-statyczna/index.md), [Deutsch](https://nofpress.com/de/blog/wordpress-zu-statischer-website/index.md), [Français](https://nofpress.com/fr/blog/wordpress-vers-site-statique/index.md), [Español](https://nofpress.com/es/blog/wordpress-a-sitio-estatico/index.md)

---

Moving a WordPress site to a static website isn't a single "export" button. It's a short project with a clear order: find out what you have, get the content out, rebuild the templates, keep every URL working, replace the few features that need a server, check everything, then switch the domain.

This guide walks through that order step by step. It follows the NoFPress migration process, and [this website runs on the same architecture](https://nofpress.com/built-with-nofpress/): content in Markdown files in Git, a static export built with Next.js, served from Cloudflare.

If your main worry is search traffic, read this together with [How to Remove WordPress Without Losing SEO](https://nofpress.com/blog/remove-wordpress-without-losing-seo/), which goes deeper into URL mapping, redirects and post-launch monitoring.

## Before you start: is your site a good candidate?

A static website is a set of pre-built files. That suits sites that are read far more often than they change:

- company and service websites,
- blogs and magazines,
- portfolios, documentation and landing pages.

Be careful if your site depends on things that react to each visitor in real time:

- **WooCommerce or another full shop** with many products, variants, coupons or customer accounts,
- **memberships, courses, logins** or user-generated content at the core of the site,
- **many editors publishing many times a day** who rely on WordPress-specific admin screens.

These can sometimes be handled with external services, but every service you add is one more thing to choose, pay for and maintain. If you need many of them, staying on WordPress is often the honest answer. Treat shops as a "check carefully" case, not a default fit: even a very small one needs its checkout handled by a separate service, which someone has to build, test and maintain.

For the longer version of this trade-off, see [Why static?](https://nofpress.com/why-static/).

## Step 1: Inventory what you have

Everything later depends on this list, so do it first and write it down.

**Every public URL.** Start with the sitemaps. WordPress has generated a core sitemap index at `/wp-sitemap.xml` since version 5.5, covering public post types, taxonomies, author archives and the homepage.[6] SEO plugins often add their own sitemap, so also read `/robots.txt` for `Sitemap:` lines. Then crawl the site from the homepage to catch what sitemaps miss: paginated archives (`/page/2/`), date and author archives, attachment pages and old pages still linked from posts. If you have Search Console access, export the pages that get impressions or clicks; those are the URLs that matter most, including ones nothing links to anymore.

**Content types.** Posts, pages, custom post types, categories, tags and custom taxonomies. Note the permalink structure: date-based (`/2024/05/post-name/`), plain post name, category base, trailing slash or not.

**Plugins, grouped by the job they do:**

| Job | Typical plugins | What it becomes |
|---|---|---|
| SEO | Yoast, Rank Math | Titles, descriptions, canonicals and sitemap generated at build time |
| Forms | Contact Form 7, WPForms, Gravity Forms | A small form endpoint outside the site |
| Performance | Caching, image optimization | Usually not needed; images are optimized once, at build time |
| Security | Firewalls, login protection | WordPress security plugins have nothing to protect on the live site (no login, no PHP), but your hosting, domain and Git accounts still need protecting |
| Content | Page builders, shortcodes, galleries | Rebuilt as templates or converted to Markdown |

**Integrations.** Newsletter sign-ups, CRM, analytics, chat widgets, embedded maps and videos. Each one needs a decision: keep, replace or drop.

### Checklist

- [ ] Full URL list with the type of each URL (post, page, category, attachment…)
- [ ] Permalink pattern and trailing-slash behaviour recorded
- [ ] Plugin list with a decision per plugin
- [ ] List of every form: fields, who receives it, where data goes

## Step 2: Export the content

There are three common ways to get content out of WordPress:

1. **The built-in export (Tools → Export).** It produces a WXR file, an XML format containing posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies and users.[4] It needs an administrator login, and it's a useful fallback when the REST API is blocked.
2. **The REST API.** Collections such as `/wp-json/wp/v2/posts` return content as JSON.[5] Results are paginated: `per_page` is capped at 100 records, and the `X-WP-Total` and `X-WP-TotalPages` headers tell you how many records and pages there are.[5] Our process prefers this route because it's scriptable and re-runnable. For content that isn't public, an owner can create an Application Password for a dedicated account (available since WordPress 5.6) and revoke it after the migration.[10]
3. **A direct database export.** Possible, but you then have to rebuild what WordPress does when it renders content yourself.

Whichever route you choose, write the export as a script you can run again, not as manual copy-and-paste. You'll re-run it at least once, after content changes during the project.

**Converting HTML to Markdown.** Post bodies come out as HTML. Before converting them to Markdown, clean them up: remove block-editor comments, inline styles, empty paragraphs, tracking pixels and scripts. Rewrite internal links from absolute (`https://example.com/about/`) to root-relative (`/about/`) so they survive the move.

**Shortcodes and page builders.** List every distinct shortcode and decide what each becomes: plain Markdown, a component, or nothing. Pages built with Elementor, Divi or WPBakery produce markup that doesn't convert cleanly. Rebuild those pages as templates and move only their text into Markdown.

**Metadata.** Keep the original publication and modification dates (never "today"), real author names, categories and tags, featured images with their alt text, and the SEO title and description. Capture the SEO data from the rendered `<head>` of the live page, because that's what search engines actually see.

**Media.** Download the original images rather than resized thumbnails, optimize them (for example to WebP), and record their width and height so pages don't jump while loading. If you can keep the old image paths (`/wp-content/uploads/...`), image links from other sites keep working without any redirects.

### Checklist

- [ ] Export script committed and re-runnable
- [ ] Every post and page converted, spot-checked side by side with the live page
- [ ] Shortcode and page-builder decisions written down
- [ ] Dates, authors, SEO titles and descriptions preserved
- [ ] Images downloaded, optimized, alt text kept (missing alt text flagged)

## Step 3: Choose a static site generator

Many tools can turn Markdown and templates into a folder of HTML files. A few examples, in no particular order:

- **Hugo**, a framework for building websites.[11]
- **Eleventy**, which describes itself as "a simpler static site generator".[12]
- **Astro**, which pre-renders pages at build time by default.[13]
- **Next.js** with static export: setting `output: 'export'` makes `next build` produce an `out` folder of HTML, CSS and JavaScript that any static host can serve.[7]

This website and our migration process use Next.js static export, mainly because one codebase covers the multilingual routing, SEO tags and build-time checks we need. That's a choice, not a ranking. The questions that matter for your site are:

- **Who maintains it?** Pick something your developer, or your agency, already knows.
- **Can it reproduce your URLs exactly?** Including date-based paths and trailing slashes. If not, you'll need more redirects.
- **Multilingual support**, if you have more than one language.
- **How editors will work.** Directly in Markdown and Git, or through a Git-based CMS on top.

One technical note on Next.js: features that need a running server, including its built-in redirects configuration, aren't available in a static export.[7] Redirects therefore live in the hosting configuration instead (see Step 5).

## Step 4: Rebuild the templates

By default, reproduce the current design. Your visitors know it, you approved it, and it keeps the comparison between old and new pages simple. A redesign is a separate decision that you can take later, or now if you explicitly want one.

Practical approach:

- Take full-page screenshots of each page type on desktop and on a phone, and use them as the reference.
- Build one template per page type: homepage, page, post, category archive, 404.
- Ship as little JavaScript as possible; use native HTML elements (such as `<details>`) for simple interactions.
- Build in accessibility from the start: one H1 per page, visible focus states, sufficient contrast, keyboard navigation.
- Reserve space for images and don't animate the main heading in. Both affect how quickly the page appears stable.

## Step 5: Preserve URLs and set up redirects

This is the step that protects your search traffic.

**Keep URLs identical wherever you can.** Configure the generator so that every new page sits at exactly the same path as before, including the trailing slash. In Next.js, `trailingSlash: true` writes `/about/index.html` and links to `/about/`.[7]

**Redirect everything that changes, permanently.** Google recommends permanent server-side redirects, such as 301 or 308, when a URL moves.[3] Redirect straight to the final destination, without chains,[1] and don't send many unrelated old URLs to the homepage.[1]

**Build the redirect file from a map, not by hand.** Our process keeps one CSV with every old URL and its fate (`keep`, `redirect` or `drop`) and generates the host's redirect file from it. On Cloudflare Pages, a `_redirects` file supports up to 2,000 static and 100 dynamic rules; beyond that, Cloudflare points to its Bulk Redirects feature.[8] Rules without a status code default to 302, a temporary redirect, so set `301` explicitly.[8] The same file can't match query strings,[8] so old `/?p=123` links need separate handling if they still get traffic.

**Decide on typical WordPress URLs explicitly:** `/feed/`, paginated archives, author and date archives, attachment pages, `/wp-content/uploads/...` and `/wp-admin/` (which can simply return 404).

The details, including what to check before and after launch, are in [How to Remove WordPress Without Losing SEO](https://nofpress.com/blog/remove-wordpress-without-losing-seo/).

## Step 6: Replace dynamic features

A static site has no server code running on each request, so anything that receives data needs a small separate service:

| Feature | Static approach |
|---|---|
| Contact and quote forms | A small serverless function (this website uses a Cloudflare Worker) that validates the submission and passes it on, for example to a spreadsheet or by e-mail |
| Site search | A search index built after the site is built and loaded in the browser. Pagefind, for example, is "a fully static search library" that runs as a step after the build.[9] |
| Comments | Drop them, keep the existing ones as static text under each post, or use a third-party service |
| Newsletter sign-up | The newsletter provider's form or API |

Our process sets two rules here. First, a form only shows "sent" when the receiving service has confirmed it. Second, every form is tested end to end, into the real inbox or sheet, before launch.

## Step 7: Verify and launch

**Before launch:**

- [ ] Every URL from the inventory either returns the new page or redirects once to a page that exists
- [ ] Titles, meta descriptions, canonicals, H1s, hreflang and structured data compared page by page between the old and new site, with every difference explained
- [ ] No internal links point to the old host or to files that no longer exist
- [ ] Every form submitted end to end
- [ ] Tested on a real phone, with the keyboard only, and with JavaScript disabled
- [ ] Staging site on a temporary hostname and marked `noindex`, as Google suggests for test copies[2]
- [ ] Full backup of the old WordPress site (files and database) stored by the owner
- [ ] All DNS records exported, including e-mail records, so mail keeps working after the switch

**Launch day:**

- Lower the DNS TTL in advance, so the change spreads faster.[2]
- Make sure Search Console verification carries over to the new site.[2]
- Remove any `noindex` from the production build, then point the domain to the new hosting.[2]
- Check the homepage, a sample of each page type, a redirect, the 404 page, `robots.txt`, the sitemap and a form submission, all on the real domain.

**After launch:**

- Submit the new sitemap in Search Console.[1]
- Watch the 404 log and Search Console's indexing reports, and add redirects for any URL that was missing from the inventory.
- Keep the old hosting available as a fallback. Google's guidance for hosting moves is to shut the old one down once its traffic reaches zero.[2]
- Expect some movement in rankings for a while. Google itself says to expect temporary fluctuation during a move.[1]

## What you end up with

The content, URLs and look of your site stay the same. What goes away is the PHP runtime, the database and the public admin panel on the live site, along with the plugin updates that came with them. What remains to look after is smaller but real: the accounts that can change the site (Git host, hosting, domain), build dependencies, and the small services behind forms.

## Not sure where your site fits?

Every site is different, and the inventory in Step 1 is where the real answers come from. If you'd like someone to do that part with you, [request a free audit](https://nofpress.com/#audit). A person, not an automated scanner, will review your site and tell you honestly whether a static migration makes sense, what it would involve and what to watch out for.

## Sources

Information as of 22 October 2026.

1. [Google Search Central — Site moves with URL changes](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes), last updated 20 August 2026.
2. [Google Search Central — Site moves without URL changes](https://developers.google.com/search/docs/crawling-indexing/site-move-no-url-changes), last updated 10 December 2025.
3. [Google Search Central — Redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects), last updated 14 April 2026.
4. [WordPress Documentation — Tools Export screen](https://wordpress.org/documentation/article/tools-export-screen/), last updated 8 June 2024.
5. [WordPress REST API Handbook — Pagination](https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/) and [Posts reference](https://developer.wordpress.org/rest-api/reference/posts/), last updated 14 October 2026.
6. [Make WordPress Core — New XML Sitemaps Functionality in WordPress 5.5](https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/), 22 July 2020.
7. [Next.js — How to create a static export](https://nextjs.org/docs/app/guides/static-exports), last updated 9 August 2026.
8. [Cloudflare Pages — Redirects](https://developers.cloudflare.com/pages/configuration/redirects/), last updated 25 August 2026.
9. [Pagefind](https://pagefind.app/), project website.
10. [Make WordPress Core — Application Passwords: Integration Guide](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/), 5 November 2020.
11. [Hugo](https://gohugo.io/), project website.
12. [Eleventy](https://www.11ty.dev/), project website.
13. [Astro — On-demand rendering](https://docs.astro.build/en/guides/on-demand-rendering/), Astro documentation.
