All WordPress HTML Templates Forms & Webhooks AI & Tools
WordPress

Migrating a Static HTML Site to WordPress Without Losing SEO

A practitioner’s guide to migrating a static HTML site to WordPress without losing SEO: URL mapping, server-level 301s, title porting and a 30 day watch plan.

A real working moment illustrating the theme of an article about html to wordpress. Wide 16:9 banner, one strong focal point, magazine editorial quality, authentic and unstaged.

A client handed us a 340 page static HTML site in early 2025. Hand-built, no CMS, ranking on page one for roughly ninety commercial terms. Their previous agency had already attempted the move to WordPress six weeks earlier; organic sessions were down 61 percent and nobody could tell us which URLs had broken, because nobody had written down what the URLs were before they started.

Migrations don’t lose rankings because WordPress is worse than static HTML. They lose rankings because the URL layer changed and no one produced a complete map of old to new. Everything else, the theme, the plugins, the page speed regression, is recoverable in a week. A missing redirect map is not, because once you’ve overwritten the old site you no longer know what you had.

So the useful version of “how to migrate to WordPress” is a sequence, with a verification step after each stage, and a decision about URL shape that you make before you install anything.

Key Takeaways

  • Build your URL inventory from four sources unioned together: a full crawl, the Search Console Pages export, 90 days of server access logs, and your backlink report. A crawl alone misses orphaned PDFs, old campaign URLs and image paths that still earn links.
  • Decide early whether to keep .html extensions or move to WordPress-style trailing slash URLs. Keeping them is possible and sometimes correct, but mixing both shapes is what produces duplicate content and redirect chains.
  • Redirects belong at the server level (nginx map or .htaccess above the WordPress block), not in a plugin table, once you pass roughly 300 rules. One hop only: old URL to final HTTPS destination.
  • Port the old <title> and meta description per URL instead of letting your SEO plugin regenerate them from templates. Yoast and Rank Math both store these in post meta and both accept a CSV import.
  • Expect 2 to 4 weeks of ranking wobble on a clean migration and judge the outcome at day 30 to 60, not day 3. If you see a cliff in the first 72 hours, it’s almost always redirects, a stray noindex, or a blocked robots.txt.

Build the inventory before you touch anything

This is the step people skip, and it’s the only one that’s genuinely irreversible. Crawl the live static site while it’s still live.

Screaming Frog is the tool we use, with JavaScript rendering off (static HTML sites rarely need it) and the crawl exported as “Internal: All” plus “Images: All”. Export the status code, the final URL, the title, the meta description, the H1, the canonical and the word count for every page. That export is your source of truth for the rest of the project.

Then add the three sources a crawler cannot see:

  • Search Console Pages report, exported as CSV. This includes URLs Google knows about that are no longer linked from anywhere.
  • Server access logs, 90 days minimum. Grep for 200 responses on .html, .pdf and image paths. This is where you find the 2017 brochure PDF that still gets 400 hits a month from a university library page.
  • Backlink export from Ahrefs or the Search Console Links report, sorted by referring domains. Any URL with third-party links is a URL you must redirect precisely, not funnel to the homepage.

Union those four lists, dedupe, and you have urls-before.txt. On that 340 page client site the crawl found 361 URLs. The union found 1,104, including 190 images that were ranking in Google Images and a directory of 80 PDF datasheets nothing on the site linked to anymore.

A real working moment that fits an article section about

The URL decision that decides the whole migration

Static sites end in .html. WordPress, by default, gives you /about-us/ with a trailing slash. You have three options and only two of them are sane.

Option A: keep the .html extensions. Set your permalink structure to /%postname%.html for posts, and for pages use a plugin or a small pagerewriterules filter to append the extension. Zero redirects needed for pages. Zero risk. This is the right call when the site has strong, aged rankings and a large link profile, and when the client has no opinion about pretty URLs. It looks dated. It also costs you nothing in rankings because Google has never cared about file extensions.

Option B: move to trailing slash URLs and redirect everything. More work, cleaner result, and the correct choice if the site is also being restructured (new service pages, merged categories, a real blog taxonomy). Do it with an explicit map, not a regex guess.

Option C: let WordPress do whatever and fix it later. This is how you end up with /about-us.html, /about-us/ and /about/ all returning 200. Don’t.

Whichever you pick, pick one trailing slash convention and enforce it at the server. Mixed slashes generate duplicate URLs, split internal link equity and double your crawl budget for no benefit.

Getting the HTML into WordPress without a rebuild

The actual html to wordpress content transfer is the least risky part, and the part every listicle spends 80 percent of its words on. Options, ranked by how often we use them:

Copy and paste into the block editor for sites under about 40 pages. Genuinely. Two hours of paste work beats four hours of debugging an importer, and you get clean block markup instead of a single HTML block containing a decade of nested divs.

HTML Import 2 or a custom WP-CLI script for anything larger. We usually write the script: parse each file with DOMDocument, pull the content out of a known selector, map it to wpinsertpost() with the slug derived from the file path, and keep a CSV of oldpath,newpost_id as the output. That CSV becomes your redirect map later, which is the whole point.

On the theme side, the temptation is to rebuild the design in a page builder. Resist it if the static site was fast. A hand-coded static page that scored LCP around 1.2s on 4G can easily land at 3.5s after an Elementor rebuild, and Core Web Vitals is a real (if small) ranking input. If the original site was built on Bootstrap, converting the markup to a Bootstrap-based WordPress theme keeps your CSS and your component classes intact; CanvasWP is what we reach for when the client wants to edit content themselves afterwards without a developer in the loop. Either way, keep the HTML structure of the old pages as close to identical as you can during the migration. Redesign later, as a separate project, once rankings have stabilised.

Write the redirects from the map, at the server level

Plugin-based redirects (Redirection by John Godley is the good one) are fine up to a few hundred rules. Past that, every 404 means a database query before WordPress can decide what to do, and on shared hosting that’s measurable. Server level is faster and survives a plugin conflict.

nginx, with the map in the http context:

# http context: generate this block from your CSV, do not hand-type it
map $uri $legacy_redirect {
    default                        "";
    /about-us.html                 /about-us/;
    /services/seo-audit.html       /services/seo-audit/;
    /downloads/datasheet-v2.pdf    /wp-content/uploads/2026/01/datasheet-v2.pdf;
}

server context: empty string is falsy in nginx, so unmapped URIs fall through

if ($legacy_redirect) { return 301 $legacy_redirect; }

Apache, in .htaccess:

# MUST sit above the "# BEGIN WordPress" block, or WP's front controller

serves a 404 before these rules are ever evaluated.

RewriteEngine On RewriteRule ^about-us\.html$ /about-us/ [R=301,L] RewriteRule ^services/seo-audit\.html$ /services/seo-audit/ [R=301,L]

A catch-all RewriteRule ^(.+)\.html$ /$1/ [R=301,L] is tempting. It’s a last resort, not a plan: it happily 301s unmapped URLs into 404s, which Google reports as soft 404s and which tells you nothing about what was lost. Use it only after your explicit map covers every URL with a link or a hit in the logs.

Two rules that matter more than the syntax. Use 301, not 302, and not meta refresh. And collapse chains: if http://old.com/x.html currently 301s to https://old.com/x.html, your new rule must point straight at https://old.com/x/ in one hop. Chains of three or more hops are where PageRank quietly evaporates.

Fixing internal links in the database

Redirects handle inbound traffic. Internal links should point at the final URL directly, which means a bulk replace after import:

# map.csv: oldurl,newurl (no header). Run with --dry-run first, always.
while IFS=, read -r old new; do
  wp search-replace "$old" "$new" \
     --precise --skip-columns=guid --report-changed-only --all-tables-with-prefix
done < map.csv

--skip-columns=guid is not optional. Rewriting GUIDs breaks feed readers and can cause duplicate items in anything that has already consumed your RSS.

Port the on-page signals, don’t regenerate them

A fresh SEO plugin will build titles from a template like %title% %sep% %sitename%. If the old static site had hand-written titles (and a site ranking for ninety terms usually does), that template will overwrite years of tuning on launch day.

Take the title and description columns out of your Screaming Frog export, match them to post IDs, and write them into post meta:

# Yoast keys. Rank Math uses rankmathtitle / rankmathdescription.
wp post meta update 142 yoastwpseo_title "Commercial Roof Surveys in Leeds | Acme Ltd"
wp post meta update 142 yoastwpseo_metadesc "Independent roof condition surveys..."

Same logic for structured data. If the old site hand-rolled LocalBusiness and FAQPage JSON-LD, check what your plugin now emits before you delete the originals. Plugin output is usually thinner than a hand-written graph, and in 2026 that matters more than it used to because AI answer surfaces lean on entity data heavily. We’ve written up what to add beyond plugin defaults in schema markup in WordPress and how citations actually get earned in answer engine optimisation.

Images deserve a specific mention. WordPress wants uploads at /wp-content/uploads/2026/02/. Your old images live at /images/ and some of them rank. The cheap fix: leave the original /images/ directory on disk, untouched, and let nginx serve it. No redirect, no lost Image Search position, no broken references in old HTML you forgot about. It’s slightly untidy. It works.

Launch day runbook

Staging should be behind HTTP basic auth, not a noindex tag. Auth cannot leak. A forgotten “Discourage search engines from indexing this site” checkbox in Settings > Reading can, and it’s the single most common cause of a total traffic collapse we get called in to diagnose. Check it twice after go-live, then check the rendered <head> for noindex with curl.

In order, on the day:

  1. Switch DNS or vhost. Confirm HTTPS and HSTS still resolve.
  2. Uncheck the search engine discouragement box. Confirm with curl -s https://site.com/ | grep -i noindex returning nothing.
  3. Delete any static robots.txt left in the web root. A physical file overrides WordPress’s virtual one, and old static sites often shipped a Disallow: / from a staging era.
  4. Verify the sitemap. WordPress core serves /wp-sitemap.xml; Yoast and Rank Math replace it with /sitemap_index.xml. Only one should be linked from robots.txt.
  5. Run the full status check against your pre-launch URL list.
# Every old URL must answer 200 or 301. Anything else is a bug, printed here.
while read -r url; do
  out=$(curl -s -o /dev/null -w '%{httpcode} %{redirecturl}' "$url")
  printf '%s\t%s\n' "$out" "$url"
done < urls-before.txt | tee status-after.tsv | grep -vE '^(200|301)'

Then submit the sitemap in Search Console and request indexing for the ten most valuable URLs manually. No Change of Address tool is needed if the domain is unchanged; that tool is for domain moves only.

The 30 day watch window

Rankings will move for 2 to 4 weeks even on a clean wordpress migration seo job. Google recrawls at its own pace, and a 301 takes time to consolidate. Judge at day 30 to 60 against the same period last year, not against last week.

What to watch, in priority order: Search Console’s Page Indexing report for “Not found (404)” and “Page with redirect” growth, your server 404 log, and Core Web Vitals in the CrUX-backed report (LCP under 2.5s, INP under 200ms, CLS under 0.1). A small logger catches the URLs your inventory missed:

addaction( 'templateredirect', function () {
    if ( ! is_404() ) {
        return;
    }
    $path = parseurl( $SERVER['REQUESTURI'] ?? '', PHPURL_PATH );
    // Skip bot noise probing for config files and missing assets.
    if ( ! $path || preg_match( '#\.(php|env|aspx|git|jpg|png|css|js|map)$#i', $path ) ) {
        return;
    }
    error_log( sprintf(
        '[MIGRATION-404] %s | ref: %s',
        $path,
        $SERVER['HTTPREFERER'] ?? '-'
    ) );
}, 1 );

Pull that log weekly and add the real misses to your map. After a month the volume should be near zero. If a particular page lost position while everything around it held, compare the old and new rendered HTML side by side. Nine times out of ten the content got shortened, an H2 got turned into a styled div, or an internal link block vanished in the theme rebuild.

One last thing that has nothing to do with SEO and everything to do with not getting a 3am call: a static site had no attack surface, and now you’re running PHP with a database. Lock it down on day one rather than month three. Our working list is in the WordPress security checklist we actually use.

Frequently Asked Questions

Will I lose rankings moving from static HTML to WordPress?

Not if the URLs resolve and the content survives intact. Google indexes URLs and content, and has no visibility into or preference for your server stack. The losses attributed to WordPress almost always trace back to missing 301s, regenerated title tags, or a page builder rebuild that cut 40 percent of the body copy.

Can I keep my .html URLs in WordPress?

Yes. Set the post permalink structure to /%postname%.html in Settings > Permalinks, and handle pages with a rewrite filter or a small plugin. It’s the lowest-risk path for a site with aged rankings and plenty of backlinks, and it removes the need for a page-level redirect map entirely.

How long should I keep the 301 redirects in place?

Permanently. There’s no point at which deleting them helps you, and old links keep arriving for years from PDFs, directories and email archives. Keep them in version control as a generated config file so they survive server rebuilds.

Should I redesign at the same time as the migration?

No, and this is the advice clients push back on most. Changing platform, URLs, template and copy simultaneously means that when traffic drops you have four suspects and no way to isolate one. Migrate on near-identical markup, wait 30 days for stability, then redesign as a separate release.

Is a plugin like Redirection good enough, or do I need server-level rules?

Plugin redirects are fine below roughly 300 rules and are much easier for non-developers to maintain. Above that, move to nginx map or .htaccess because every miss costs a database round trip before WordPress can respond. A hybrid works well: bulk legacy rules at the server, ad hoc fixes in the plugin.

What to do next

Before you install WordPress, do one thing: crawl the live static site, export it, and commit that export to a repository. Add the Search Console export, 90 days of access logs and your backlink list. That file is the difference between a migration you can verify and one you can only hope about.

If the site is under 40 pages with few third-party links, keep the .html extensions, paste the content in by hand, and you’ll be done in a weekend with no redirect map at all. If it’s larger, budget as much time for the URL map and the status verification as for the theme. That’s the split that separates the migrations we’re proud of from the ones we got hired to repair.

.html permalink structure wordpress 301 redirect map static html to wordpress html to wordpress migration without losing rankings migrating static HTML site to WordPress preserve title tags and meta descriptions in wordpress migration static site to wordpress url inventory crawl wordpress migration seo checklist wp-cli search-replace internal links migration