FormRill
  1. Blog

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.

By FormRill team4 min read

Why static wins for a brochure site or blog

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-markdown

If 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.

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            301

Neither 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

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 free

Related