Move WordPress to a static site and cut hosting costs
Most small WordPress sites are brochures and blogs. Nobody logs in except you, and the pages barely change. For those sites, a static site is faster, cheaper and safer, and the move takes an afternoon or two.
Why static wins for a brochure site or blog
- Faster pages. A static page is a finished HTML file served from a CDN edge close to the visitor. There is no PHP to run and no database query before the first byte, which helps Largest Contentful Paint and the other Core Web Vitals that Google uses as a ranking signal.
- Cheaper hosting. Cloudflare Pages, GitHub Pages and Netlify all host static sites on free tiers. You stop paying for a server that mostly sits idle.
- Less to secure. No login page to brute-force, no plugins to patch, no database to leak. The attack surface is a folder of files.
- Backups for free. The whole site lives in a Git repository, so every change is versioned.
Static is the wrong fit if non-technical editors publish daily through the WordPress editor, or if the site runs a shop, memberships or logged-in features. Keep WordPress for those, or move only the marketing pages.
1. Export your content
In WordPress, open Tools → Export, choose All content and download the XML file. Then copy wp-content/uploads from your host over SFTP or your host’s file manager, so you have every image.
Convert the export to Markdown. The open-source wordpress-export-to-markdown tool turns each post into a Markdown file with front matter and downloads its images:
npx wordpress-export-to-markdownIf your theme is heavy on page-builder layouts, the Simply Static plugin is the other route: it crawls your live site and saves it as plain HTML you can host as-is.
2. Pick a static site generator
Any of these will do. Pick the one whose templates you’d rather edit.
- Astro: HTML-first components, ships zero JavaScript by default, reads Markdown posts directly.
- Hugo: a single binary that builds thousands of pages in seconds.
- Eleventy or Jekyll: simple templates, mature communities.
3. Migrate posts and keep every URL
Your existing URLs carry your search rankings and backlinks. Keep them identical. Check your permalink setting in Settings → Permalinks, then mirror it in your file structure. If posts lived at /2024/05/my-post/, put the Markdown at src/pages/2024/05/my-post.md in Astro, or set permalinks in Hugo’s config.
Then crawl your old sitemap and confirm every URL returns a page on the new build before you switch DNS.
4. Redirect whatever does change
For pages you merge or drop, add permanent redirects. Cloudflare Pages and Netlify both read a _redirects file at the site root:
/old-page/ /new-page/ 301
/category/news/* /blog/ 301
/feed/ /rss.xml 301Neither host matches query strings in this file, so old /?p=123 links can’t be redirected this way; that only matters if you never switched on pretty permalinks. GitHub Pages has no server-side redirects, so use a meta refresh page or a plugin such as jekyll-redirect-from there.
5. Replace contact forms
Contact Form 7, WPForms and Gravity Forms all need PHP, so they stop working on a static host. Keep your form markup and point its action at a form backend. With FormRill, create a form in the dashboard (one click, and it already emails you) and paste its URL:
<form method="POST"
action="https://api.formrill.com/YOUR_FORM_ID/submit">
<input type="checkbox" name="botcheck" hidden />
<input type="text" name="name" required />
<input type="email" name="email" required />
<textarea name="message" required></textarea>
<button type="submit">Send</button>
</form>Rename plugin field names such as your-email or input_2 to plain ones like email, so notifications read cleanly and Reply goes to the visitor. Email delivery and spam protection are free. With Pro features (free during the beta), the same form can also feed Google Sheets, a webhook or your CRM, the jobs WordPress add-ons used to do.
Two things don’t carry over yet: file upload fields (coming soon) and importing old plugin entries. Export past entries from WordPress before you switch the old site off. Conditional logic and multi-step forms need to be rebuilt in your own markup and JavaScript. Moving many client sites? See FormRill for agencies.
6. Handle the other dynamic bits
- Search: Pagefind builds a static search index at build time.
- Comments: drop them, or use a hosted comment service.
- RSS and sitemap: most generators ship plugins for both. Keep the feed at its old path or redirect it.
7. Deploy and switch DNS
Push the project to GitHub and connect it to Cloudflare Pages, Netlify or GitHub Pages. Each one can build on every push, and Cloudflare Pages and Netlify also give you a preview URL. Check the new build, then point your domain at the new host and keep the old WordPress host for a week in case you missed something.
After the switch, submit your sitemap in Google Search Console and watch the Pages report for 404s you need to redirect.
Want the numbers? See a worked cost example.
Replace your WordPress contact form
Free up to 500 submissions a month and unlimited forms. No server, no credit card.
Start freeRelated
- WordPress to static: a worked cost example
What the move saves, with every assumption stated.
- Astro contact form
A form component for your new static site.
- Hugo contact form
The same for Hugo.