cruntrix
BUILDTUTORIAL

WordPress to static site: how to move your blog, step by step

Two ways to go from WordPress to a static site: keep WordPress as a private editor and export HTML, or move your posts to Markdown and leave it behind. What you need, the steps, and the mistakes that cost traffic.

Research-based: specs + published reviews

Cover reading WordPress to a static site, with a terminal window illustration

A WordPress site needs a server running PHP and a database, plus regular updates to WordPress itself, its theme and every plugin. A static site is just files: HTML, CSS, images. It loads fast, costs little or nothing to host, and has no login page for anyone to break into. This tutorial shows you how to move a WordPress site to a static site without losing your posts, your images or your search traffic.

Two ways to move WordPress to a static site

If you want to… Do this Effort
Keep writing in WordPress Run WordPress privately and export it as static HTML with a plugin An afternoon
Leave WordPress behind Convert your posts to Markdown and rebuild the site with a static site generator A weekend or more

The export route keeps your design and your editing habits. The rebuild route gives you a cleaner, faster site that you fully control, at the cost of choosing or building a new design. Both routes need the same groundwork, and both end the same way: redirects, testing and going live.

What you need

Route 1: export WordPress as static HTML

  1. Make a private copy. Run WordPress on a staging site or your own computer, so the live site keeps working while you test.
  2. Install Simply Static. In WordPress, go to Plugins → Add New, search for Simply Static, then install and activate it.
  3. Replace forms and search first. Contact forms, comments, logins and the built-in search need a server, so they stop working on a static copy. Swap them for a form service and a JavaScript search before exporting. Simply Static’s paid Pro version can handle forms and search for you.
  4. Generate the site. Open Simply Static in the admin menu, check the settings, and run the export. The free plugin gives you a ZIP file or a folder of HTML.
  5. Upload the files to your host. Our guide to hosting a static site on Cloudflare Pages walks through it.

From now on, you write and edit in your private WordPress, then re-export and upload to publish.

Route 2: convert your posts to Markdown and rebuild

  1. Export your content. In WordPress, go to Tools → Export, choose All content, and download the XML file. “All content” matters: without it you won’t get your pages and images.
  2. Convert it to Markdown. Put the file in an empty folder, open a terminal there and run npx wordpress-export-to-markdown. A short wizard asks a few questions, then saves each post as a Markdown file with its title, date and other details at the top, downloads your images and updates the image links.
  3. Pick a static site generator and a theme. Eleventy, Hugo and Astro all work with Markdown posts. Copy your converted posts into the generator’s content folder and run it locally until the posts look right.
  4. Keep your URLs. Set the generator’s permalink pattern to match your old WordPress one, such as /post-name/. Every post that keeps its address keeps its search rankings.
  5. Replace the dynamic parts. Use a form service or a small serverless function for contact forms, a JavaScript search library for search, and a hosted comment service if you want comments.
  6. Push to GitHub and connect your host. Every push then rebuilds and publishes the site automatically.

If you’re new to code, an AI assistant can help you adjust templates and fix build errors; our tutorial on building a browser game with AI shows how to prompt it well.

Set up redirects for anything that moved

Some URLs will change: category and tag archives, page-numbered lists, or posts you decide not to keep. Tell the host where each old address now lives with a 301 redirect, which tells browsers and Google the move is permanent.

On Cloudflare Pages, you list them in a plain text file called _redirects in your output folder, one per line:

/old-post-name/  /new-post-name/  301
/category/news/  /news/  301

A _redirects file holds up to 2,000 static redirects plus 100 dynamic ones (patterns with wildcards). Bigger sites can use Cloudflare’s Bulk Redirects instead.

Go live and check

  1. Test on the host’s preview address before switching your domain: click through menus, open your top pages, and try the forms.
  2. Point your domain at the new host and wait for it to switch over.
  3. Visit your most important old URLs. Each should load or redirect, never show “not found”.
  4. Submit your new sitemap in Google Search Console, and watch its indexing report for a few weeks.
  5. Keep the old site for a few weeks before you cancel the hosting, in case you need to copy something you missed.

Common mistakes

FAQ

Will moving from WordPress to a static site hurt my Google rankings?

Not if every old URL either stays the same or redirects (with a 301) to its new address, and your titles and content stay the same. Rankings drop when old URLs start returning 'not found'. Check your most visited pages one by one after the move, and submit your new sitemap in Search Console.

Can I still write posts in a visual editor?

Yes. If you export with Simply Static, you keep writing in WordPress as before and re-export to publish. If you move to Markdown, you can write in any text editor, or add a Git-based content manager that gives you an editing screen on top of your files.

SOURCES

Nate ArdenEditor of Cruntrix. Edits every article before it goes up and writes the Build section.