Home / Blog / WordPress to GitHub Pages
Migration · How-to

How to Move a WordPress Site to GitHub Pages (and When Not To)

Short answer: You can't run WordPress on GitHub Pages, because it only serves static files, no PHP, no database. So the move is really three steps: convert your WordPress site to static HTML, push those files to a GitHub repository with Pages enabled, then point your custom domain at it (GitHub gives you free HTTPS). It's free and fast. The two catches to know first: GitHub Pages can't do real 301 redirects, which matters for keeping your Google rankings, and after the move you edit by committing code, with no friendly editor. If those trade-offs don't work for you, a static host that keeps redirects and an editor is the better fit.

GitHub Pages is a genuinely good way to host a small, fast site for free, and "move my WordPress site to a static GitHub site" is a popular goal for exactly that reason. The important thing to understand up front is what GitHub Pages is: a host for static files. It serves pre-built HTML, CSS, JavaScript and images, and nothing that needs a server to think, which is precisely what makes it fast, free and secure. WordPress, by contrast, runs PHP and a database on every request. So you don't move WordPress onto GitHub Pages; you turn your WordPress site into static files, then host those.

Step 1: Convert WordPress to static HTML

This is the real work, and it's the same first step as any static migration. You generate a static copy of your live site, pages, posts, images, styles, as plain HTML. Common routes are a plugin like Simply Static or WP2Static, a crawler that saves your site to disk, or a full rebuild. We cover the options honestly in converting WordPress to static HTML and the end-to-end process in migrating WordPress to a static site. Whatever tool you use, the goal is a folder of static files that looks and reads exactly like your current site.

Step 2: Create a GitHub repository and enable Pages

Put those static files in a new GitHub repository. Then, in the repository's Settings, open the Pages section and choose the branch and folder to publish from. GitHub builds and serves your site at yourname.github.io/repo within a minute or two. The official GitHub Pages documentation walks through the exact clicks and the supported publishing sources.

Step 3: Add your custom domain and HTTPS

You don't want github.io as your public address. In the Pages settings, add your custom domain (for example yourdomain.com), then at your domain registrar point the DNS records at GitHub Pages as their docs specify. GitHub provisions a free HTTPS certificate automatically once the domain verifies, so your site loads on https:// with no extra cost.

Step 4: The redirects problem (read this before you switch)

Here's the catch that catches people out. If any URL changes in the move, you need a 301 redirect from the old address to the new one, or you lose the rankings tied to that page. GitHub Pages can't issue real 301 redirects, because it serves static files with no server configuration. The workarounds, a Jekyll redirect-from plugin or per-page HTML meta refreshes, are weaker signals than a true 301 and fiddly to maintain across a whole site. If your URLs stay identical, you sidestep this. If they change, this single limitation is the biggest reason an SEO-sensitive site outgrows GitHub Pages.

Step 5: How you'll edit from now on

Once you're on GitHub Pages, updating the site means editing files in the repository and committing, which republishes it. That's fine if you live in Git and HTML. For a non-technical owner it's the real trade: changing a phone number, swapping a photo or adding a service now means touching code or re-running a static-site generator, instead of clicking "edit" on the page. Nothing is broken, it's just developer work for every change.

Is GitHub Pages the right home for your site?

It's a great fit if you're comfortable with code, your URLs won't change, and you want free, fast, secure hosting for a site you'll edit through Git. It's a poor fit if you need reliable 301 redirects to protect rankings, or if a non-developer has to keep the site up to date. Those two gaps, real redirects and a friendly editor, are exactly what a purpose-built static platform adds on top of the same speed and ownership. We lay out the general trade in the benefits and weaknesses of static sites, and the plain host mechanics in moving a website to a new host.

The middle path: static speed, without the plumbing

ShiftPress exists in the gap GitHub Pages leaves. It converts your WordPress site to clean static code, the same win, then hosts it, sets up the real 301 redirects automatically so your Google rankings carry over, and gives you an editor: you change the site by chat or by clicking the page, no Git, no code, no manual rebuilds. So you get the speed, security and ownership of a static site on GitHub Pages, without the redirect gap and without turning every edit into a developer task.

Static-site speed, with redirects and an editor

ShiftPress turns your WordPress site into clean static code, hosts it, sets up the 301 redirects so Google follows you, and lets you edit by chat or by clicking the page. All the upside of GitHub Pages, none of the plumbing. Start free now.

Migrate my site

Frequently asked questions

Can I host a WordPress site on GitHub Pages?
Not WordPress itself. GitHub Pages only serves static files; it can't run PHP or a database, which is what WordPress needs. So you convert your WordPress site into static HTML first and publish that. Once it's static, GitHub Pages hosts it for free.
Does GitHub Pages support 301 redirects?
No, not real server-side 301s, and this is the biggest catch for an SEO-sensitive migration. GitHub Pages serves static files with no server config, so you can't issue proper 301s. The workarounds (a Jekyll redirect plugin or HTML meta refreshes) are weaker signals than a true 301 and easy to get wrong at scale. If keeping rankings matters, this is the main reason people pick a host that can do real redirects.
Is GitHub Pages free, and can I use my own domain?
GitHub Pages is free for public repositories and gives you a yourname.github.io address. You can point your own custom domain at it and GitHub provisions HTTPS for free. There are soft usage limits (around 1 GB repo size, 100 GB/month bandwidth) that are fine for a normal brochure or blog site.
How do I edit the site after moving to GitHub Pages?
By editing files in the repository and committing, which republishes the site. That's comfortable in Git and HTML, but there's no friendly editor: updating a phone number or adding a service means touching code or rebuilding your static generator. For a non-technical owner that's the real cost, and it's why platforms that pair static hosting with an editor exist.

The bottom line

Moving a WordPress site to GitHub Pages really means converting it to static HTML and hosting those files, and for a code-comfortable owner with stable URLs it's a fast, free, secure home. The two things to weigh before you commit are the lack of real 301 redirects, which puts rankings at risk whenever a URL changes, and editing that now happens through Git rather than a page editor. If both suit you, GitHub Pages is a fine choice. If you want the same static speed with real redirects and an editor a non-developer can use, that's the gap a managed static migration is built to fill.

Explore ShiftPress

Move off WordPress without losing anything Edit with AI: change your site by talking