How to Move Your Website from WordPress to Cloudflare Pages — Step by Step
A detailed walkthrough of how we migrated a dental practice website from WordPress to Cloudflare Pages, cutting costs from $1,265/year to $136/year with better performance.
We’ve written before about why we moved to Cloudflare Pages and how we built the site for $0/month hosting. This post is the detailed, step-by-step guide for anyone who wants to do the same thing.
We’re not going to gloss over anything. If you’re technical enough to follow along, you’ll have a working site by the end. If you’re not, this will give you a clear picture of what’s involved so you can brief someone (or an AI) to do it for you.
What we were paying on WordPress
Before we get into the how, here’s the why. This is what our WordPress dental practice website was actually costing us per year:
| Item | Annual cost |
|---|---|
| WordPress hosting ($29/mo, 100GB incl. email) | $348 |
| Gravity Forms Elite (signatures + PDF add-ons) | $259 |
| Formidable Forms Business (forms to PDF) | $199.50 |
| Formidable PRO2PDF (PDF output) | $89 |
| Slider Revolution (sliders) | $35 |
| Yoast SEO Premium | $99 |
| Wordfence Premium (security) | $149 |
| UpdraftPlus (backups) | $70 |
| Domain name (.com.au) | $17 |
| Total | $1,265.50/year |
And we needed two form plugins because neither one could do everything. Our new patient registration form was 91 fields across 4 pages — medical history, medications, allergies, insurance, financial agreement, privacy policy, with a signature at the end. It had 47 conditional logic rules so the form adapts as the patient fills it in. Select “Yes” to being in pain, and follow-up questions appear — where’s the pain, what kind, how long. Same for medical conditions, medications, allergies. On the surface it looks like a short form, but it gets deep as patients click through it.
The signature add-on alone required Gravity Forms Elite at $259/year — the Pro plan at $159 doesn’t include it. That’s an extra $100/year just to let a patient sign a consent form.
After the move? Our only costs are the domain ($17/year) and Google Workspace for email ($119/year, since our old hosting bundled email). Total: $136/year.
What you’ll need
- A GitHub account (free)
- A Cloudflare account (free)
- Node.js installed on your computer (free)
- A text editor — VS Code is free and excellent
- About 4–6 hours for a typical small business site
- Optional: an AI assistant like Claude to write the code for you
Step 1: Export your WordPress content
Before you touch anything, get your content out of WordPress.
- Log into your WordPress admin panel
- Go to Tools → Export
- Select All content and download the XML file
- Download your media library — go to the uploads folder via FTP or your hosting file manager and download the entire
wp-content/uploadsdirectory - If you have forms (Gravity Forms, Formidable, etc.), export them as JSON from their respective settings pages
- Screenshot your existing site — every page. You’ll want a reference for the layout and content
Don’t skip the screenshots. When you’re rebuilding, you’ll want to see exactly what the old site looked like without having to keep your WordPress hosting running.
Step 2: Set up your new project
We use Astro as our static site generator. It builds fast, lightweight HTML pages with zero JavaScript overhead by default. Open your terminal and run:
npm create astro@latest my-website
cd my-website
npm install Choose the “empty” template when prompted. You’ll build the structure yourself (or have AI do it).
If you want Tailwind CSS for styling (we recommend it):
npx astro add tailwind Initialise a Git repository:
git init
git add -A
git commit -m "Initial Astro project" Step 3: Build your page structure
Look at your WordPress site screenshots. Most small business sites have a similar structure:
- Homepage
- About / About Us
- Services (or Solutions)
- Contact
- Blog (optional)
- Forms (new patient registration, enquiry, etc.)
In Astro, each page is a file in src/pages/. Create a file for each page:
src/pages/index.astro → Homepage
src/pages/about.astro → About
src/pages/services.astro → Services
src/pages/contact.astro → Contact
src/pages/blog/index.astro → Blog listing
Create a layout component in src/layouts/ that contains your header, footer, navigation, and meta tags. Every page imports this layout, so you only write it once.
This is where AI shines. Instead of hand-coding each page, you can describe your site to Claude or a similar AI and it will generate the entire structure — layouts, components, pages, navigation, styling — in one pass. Feed it your screenshots and content export, and it will rebuild the site matching your existing design.
Step 4: Migrate your content
Take the content from your WordPress export (the XML file) and place it into your new Astro pages. This is mostly copy-paste work:
- Page text goes into the corresponding
.astrofile - Images go into
public/images/orsrc/assets/ - Blog posts become individual files in
src/pages/blog/
Optimise your images as you go. WordPress sites often have unoptimised images that are 2–5MB each. Use a tool like Squoosh to compress them. A 3MB image can usually be reduced to 100–200KB with no visible quality loss.
Many WordPress sites pay $59/year or more for an image optimisation plugin like Imagify or ShortPixel. With a static site, you optimise once during migration and the images stay optimised forever.
Step 5: Rebuild your forms
This is the part that most guides skip, and it’s the part that matters most for businesses like dental practices. Your forms aren’t simple contact forms — they’re complex, multi-page, conditional documents.
On a static site, you have a few options for forms:
- Cloudflare Workers — serverless functions that process form submissions. Free tier includes 100,000 requests per day. This is what we use.
- Formspree or Formsubmit — third-party form backends with free tiers. Good for simple contact forms.
- Custom API endpoint — if you already have a server, point your forms at it.
For our 91-field patient intake form with conditional logic, signatures, and PDF generation:
- Conditional logic is handled with vanilla JavaScript in the browser. When a patient selects “Yes” to a condition, JavaScript shows the relevant follow-up fields. No plugin needed — it’s just
addEventListenerand CSSdisplaytoggling. - Signature capture uses an open-source library like signature_pad. It renders a canvas that captures the signature as an image. Free. No $259/year license.
- PDF generation happens server-side when the form is submitted. A Cloudflare Worker or your API endpoint receives the form data and generates the PDF. Libraries like jsPDF or server-side tools handle this at zero cost.
- Save and continue stores the form state in the browser’s localStorage. Patients can close the tab, come back, and their progress is still there.
Every feature we were paying $547/year for across two form plugins and two PDF add-ons is now built with free, open-source tools. And because it’s our own code, we can customise it however we want — no plugin limitations.
Step 6: Handle SEO
On WordPress, you were probably paying $99/year for Yoast SEO Premium. Here’s what Yoast actually does, and how to do it for free:
- Meta titles and descriptions — add them directly in your Astro layout component. One line of code per page.
- Open Graph tags — same thing. A few meta tags in your layout’s
<head>. - XML sitemap — Astro has a built-in sitemap integration. One command:
npx astro add sitemap. - robots.txt — create a file at
public/robots.txt. Two lines of text. - Schema.org structured data — add a JSON-LD script tag in your layout. AI can generate this for your business in seconds.
- Canonical URLs — one meta tag per page.
That’s it. Everything Yoast does is just meta tags and a sitemap. You don’t need a $99/year plugin for that.
Step 7: Set up security (for free)
On WordPress, you were paying $149/year for Wordfence because WordPress is a constant target for attackers. PHP vulnerabilities, plugin exploits, brute-force login attempts, SQL injection — WordPress sites need active security monitoring.
A static site on Cloudflare Pages has none of these problems:
- No server to hack — there’s no PHP, no database, no login page, no admin panel. There’s nothing to exploit.
- No plugin vulnerabilities — there are no plugins running on a server.
- SSL is automatic — Cloudflare provides free SSL certificates for every site.
- DDoS protection is built in — Cloudflare’s network handles this automatically.
- No updates to miss — there’s no WordPress core, no PHP version, no plugin updates that could break your site at 2am.
The $149/year you were spending on security was protecting you from problems that only exist because of the platform you were on. Remove the platform, remove the problem.
Step 8: Set up backups (for free)
On WordPress, you were paying $70/year for UpdraftPlus to back up your site. That makes sense when your site is a complex WordPress installation with a database, a theme, plugins, and uploaded media that all need to stay in sync.
On Cloudflare Pages, your backup strategy is built in:
- Your code is in GitHub — every change is versioned. You can go back to any point in history.
- Cloudflare keeps every deployment — you can roll back to any previous version with one click.
- There’s no database to back up — the site is just files.
That’s $70/year saved, and the backup is actually better — more granular, more reliable, and instant to restore.
Step 9: Push to GitHub
Create a repository on GitHub (free) and push your code:
gh repo create my-website --public --source=. --push Or if you prefer the manual way:
- Go to github.com/new and create a new repository
- Follow the instructions to push your existing code
Step 10: Deploy to Cloudflare Pages
- Log into Cloudflare Dashboard
- Go to Workers & Pages
- Click Create → Pages → Connect to Git
- Select your GitHub repository
- Set the build command to
npm run build - Set the output directory to
dist - Click Save and Deploy
Your site will build and deploy in about 30–60 seconds. Cloudflare gives you a free .pages.dev subdomain immediately. Every future push to your main branch will automatically rebuild and redeploy the site.
Step 11: Connect your domain
- In your Cloudflare Pages project settings, go to Custom domains
- Add your domain (e.g.,
yourbusiness.com.au) - If your domain is already on Cloudflare, the DNS records are added automatically
- If it’s elsewhere, transfer it to Cloudflare or update your nameservers
- SSL certificate is provisioned automatically — no configuration needed
Once DNS propagates (usually a few minutes to a few hours), your site is live on your domain.
Step 12: Cancel your WordPress hosting
Once your new site is live and you’ve verified everything works:
- Keep your WordPress hosting active for a week as a safety net
- Test every page, every form, every link on the new site
- Check Google Search Console for any crawl errors
- Submit your new sitemap to Google
- Cancel your WordPress hosting
- Cancel all your plugin subscriptions — Gravity Forms, Formidable, Yoast, Wordfence, UpdraftPlus, Slider Revolution
- Set up Google Workspace or another email provider if your hosting bundled email
That’s over $1,100/year in net savings, even after adding Google Workspace for email.
The final comparison
| WordPress (before) | Cloudflare Pages (after) | |
|---|---|---|
| Annual cost | $1,265.50 | $136 (domain + email) |
| Page load time | 3–4 seconds | <1 second |
| Google PageSpeed | 60–75 | 95–100 |
| Security plugins needed | Yes ($149/yr) | No — nothing to exploit |
| Backup plugins needed | Yes ($70/yr) | No — Git + Cloudflare handle it |
| SEO plugins needed | Yes ($99/yr) | No — just meta tags |
| Form plugins needed | Yes ($547/yr for two plugins + PDF add-ons) | No — built with free open-source libraries |
| Maintenance | Constant (updates, patches, compatibility) | None — static files don’t break |
| Can AI update it? | Limited | Yes — AI reads and writes code directly |
Is this right for you?
If your website is mostly informational — a handful of pages describing your business, a contact form, maybe a blog — then yes. You’re paying for infrastructure you don’t need.
This works especially well for dental practices, medical clinics, professional services, and trades — businesses where the website is a brochure, not an application.
The catch: you need someone comfortable with code, or an AI tool that can write it for you. There’s no drag-and-drop editor. But once it’s set up, the site essentially runs itself — no updates, no patches, no plugin conflicts, no hosting fees.
Not sure if the switch makes sense for you? Get a free website audit — we’ll analyse your current site’s speed, SEO, and hosting costs so you can see the numbers for yourself. No strings attached.
Want to See How Your Website Stacks Up?
We'll audit your current website for free — performance, SEO, AHPRA compliance, and hosting costs. You'll get a detailed PDF report showing exactly where you stand and what you could save. No strings attached.
Get Your Free Website Audit →