Contents

11/15/2026

Moving WordPress to Static Without Losing Search Traffic

Short answer: every address the WordPress site ever answered has to keep answering after the move: the same page, a 301 to its closest replacement, or a deliberate 410. List every address before writing a single rule, generate the rules from that list, and test all of them against a real Apache server running your real .htaccess, because a dev preview never reads that file. Then break your checker once on purpose, so a pass means something.

This is how our sites moved off WordPress in 2026, this one included, and the numbers below come from those moves.

Find every old address before writing a rule

WordPress knows about fewer of its own URLs than you would expect. Google's guide to site moves with URL changes says to build the list from sitemaps, server logs, analytics, the CMS and Search Console's Links report, and to include images, video, JavaScript and CSS. On brandager.com, on 08/31/2026, the sources disagreed:

Source What it found
The WordPress sitemap 27 URLs: 16 posts, 11 pages
Search Console, 480 days 44 URLs with impressions, 9 of them missing from the sitemap
The host's access log Six days retained, nothing beyond the home page
The old redirect table Nothing; no content redirect had ever been set up

The nine the sitemap missed included a contact page with 106 impressions and the indexed child pages of a directory plugin that no longer had a page.

Every address then gets exactly one disposition: kept at the same URL, 301 to a named target, or 410. The build fails on any address with none. On tools.belchamber.us that list holds 566 addresses today: 65 kept exactly, 501 redirected.

Export the Search Console baseline before you start, and commit it. Search Console keeps 16 months, and the window rolls. Here, only 123 of roughly 505 URLs had earned an impression in 480 days, and migrating all 69 posts among them, rather than the top 30, kept 91.3% of measured impressions instead of 84.1%.

Keep redirects as data, and generate the rules

Each site keeps its redirects in one YAML file, and a generator writes them into a marked block of .htaccess that nobody edits by hand. Moving the old rules into that file compared before and after, rule for rule, and refused to write if one would be lost or invented. A build gate checks that every target resolves:

- from: /find-broken-images-on-your-website-fast-with-this-free-plugin/
  to: /articles/wordpress-articles/find-broken-images-plugin/
RewriteCond %{DOCUMENT_ROOT}/_site%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}/_site%{REQUEST_URI}/index.html !-f
RewriteRule ^find-broken-images-on-your-website-fast-with-this-free-plugin/?$ /articles/wordpress-articles/find-broken-images-plugin/ [R=301,L]

The two conditions stop a redirect from hiding a page the build now serves at that address. That old address answered 301 to the new one when we checked it on 10/26/2026.

Point each redirect somewhere related. Google says redirecting many old URLs to one irrelevant page, such as the home page, "might be treated as a soft 404 error." Here, a retired post goes to its own category archive, and three near-duplicate posts on another site became one page that all three 301 to. That is a better bet than the home page, not a guarantee.

A 301 into a missing page is worse than no rule. It spends the old address and delivers nothing. When we archived unused images, thirty redirect rules pointing at them came out too. The same logic sets the order on deploy day: content first, routing straight after. On belchamber.us the routing went first once, and for a few minutes three addresses Google knew, one with 62 impressions, redirected to pages that were not live yet.

The Apache traps that read fine and behave wrong

Apache HTTP Server has a few .htaccess behaviors that no amount of reading the file will show you:

Trap What actually happens Where it is documented
A pattern starting ^/ in .htaccess Never matches: per-directory matching strips the leading slash mod_rewrite, "What is matched?"
[R] or Redirect with no status Sends 302, not 301 RewriteRule flags; mod_alias
Redirect 301 /category/news /news Prefix match: /category/news/page/2/ goes to /news/page/2/, which may not exist mod_alias, Redirect
/?p=123 shortlinks A RewriteRule pattern never sees the query string mod_rewrite, "What is matched?"
An .htaccess in a subdirectory Replaces the parent's rewrite rules for that subtree unless RewriteOptions Inherit mod_rewrite, RewriteOptions
[L] in .htaccess Ends the pass, then the rewritten URL runs the rules again; [END] stops RewriteRule flags, END
Redirect mixed with RewriteRule In .htaccess, mod_alias runs first When not to use mod_rewrite
An internal rewrite to /404.html Serves the error page with status 200, a soft 404 Found under our own test harness

Two of these deserve a note. Google's own redirects page shows RewriteRule "^/service$", which works in the main server config and silently never matches if you paste it into .htaccess.

For shortlinks, match the query string in a condition and drop it from the target:

RewriteCond %{QUERY_STRING} (^|&)p=1234(&|$)
RewriteRule ^$ /articles/wordpress-articles/the-post/ [R=301,L,QSD]

We left them unmapped here, because no ?p= address appeared in 16 months of Search Console data.

Test under real Apache, not a dev preview

Astro's astro preview serves the built site from its own local server, not Apache, so it never reads .htaccess; Astro's own docs describe it as a check before deploying, not a production server. Every redirect passes there by never running, which is evidence one step removed from the thing itself.

So the deploy runs the build under real Apache in a Podman container (or Docker), with the site's real .htaccess, laid out the way the host lays it out, and asks for every inventoried address. On restorationadvertising.com that was 1,235 old addresses before its first static release on 09/28/2026; all of them answered correctly on the live site afterward.

What that container caught that reading the file did not:

  • A force-HTTPS rule that relied on the host's proxy header. On the host it worked. Anywhere else, every request, including the harness's own readiness check, redirected to the live site.
  • A DirectoryIndex set to an absolute path, which served the home page, 200 OK, for any directory request no rule handled (09/11/2026).

The container is not your host: versions differ, and old files left in the web root are not in it. Leftover directories on belchamber.us carried their own .htaccess, and a redirect that plainly existed answered 200 at the old URL until they were cleared (09/06/2026). Sweep the live host again right after cutover.

Prove the check can fail

A check you have never seen fail is a guess. Three real ones that passed everything:

  • A deploy hook that always exited 0. It ran if harness; then exit 0; fi and then read $?, which after an if is the status of the if, not of the command. Measured on 09/07/2026: harness exit 1, hook exit 0. The fix captures it on the command's own line, harness || STATUS=$?.
  • A dropped-page check that treated HTTPS as a removal. It reads the live sitemap and refuses a build that drops a page nobody declared removed. The site-wide HTTPS redirect matches every address, so it counted as a declaration for all of them, on three sites (found 09/28/2026). None had actually dropped a page, which is luck, not proof. It now has a test that plants a dropped page on a site with that redirect and expects a refusal.
  • Image redirects that were never live. On this site they were first written to a separate file that nothing put on the server. Moved into .htaccess, they then sat under WordPress's own cms/.htaccess, the subdirectory trap above, until WordPress was deleted on 09/04/2026.

A minimal sweep, with an inventory of old-path<TAB>expected, where expected is 200, 410 or the redirect target:

BASE=$1; failed=0
while IFS=$'\t' read -r path want; do
  out=$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}' "$BASE$path")
  code=${out%% *}; loc=${out#* }
  case "$want" in
    200|404|410) got=$code ;;
    *) got="${loc#"$BASE"}"; [ "$code" = 301 ] || got=$code ;;
  esac
  [ "$got" = "$want" ] || { echo "FAIL $path: expected $want, got $got"; failed=1; }
done < "$2"
exit $failed

Feed it one row you know is wrong and confirm it fails. Our first version ended the format string with \n, which curl on Windows writes as CRLF, and it failed a correct row. Prove it passes for the right reason too. Use curl rather than a browser, because a browser caches a 301 indefinitely, and check status codes yourself, since curl exits 0 on a 404.

What the moves showed, and what they can't

Four of the sites kept a committed Search Console baseline, each a 480-day window. This is the traffic that was at stake:

Site Window ends Pages with impressions Impressions Clicks
tools.belchamber.us 08/29/2026 123 7,176 15
brandager.com 09/06/2026 47 30,593 66
belchamber.us 09/06/2026 48 8,035 30
nextdayvideos.com 09/06/2026 4 64 1

Brandager's 44 in the first table is the 08/31/2026 count; the committed baseline above runs to 09/06/2026 and lists 47 pages, and I have not reconciled the two. Two things stand out. The stakes were small: 112 clicks in total across 480 days, on four sites. And the impressions were concentrated. On brandager.com, two pages account for 90.8% of them (18,086 and 9,702) at average positions of 80.7 and 86.7, with 10 clicks and none. On belchamber.us, the top page has 4,618 impressions at position 71.7 and no clicks. A broken redirect would have cost little in clicks. That is not a reason to skip the inventory, because the sitemap alone would not have found the pages that mattered: it missed nine of the 44 on brandager.com.

I can't show a before-and-after for traffic. The only later numbers I hold come from a catalog that counts posts alone and merges Search Console with Bing, so putting them beside these would compare two different measures. I won't claim traffic held. What I can show is that the redirects answer, which the sweep above checks on every address.

Other effects were measured on the day. When belchamber.us went static on 09/06/2026, the home page answered in 0.33 seconds against 9.9 seconds a few hours earlier, one reading each, not a benchmark. The server check then found 226 leftover PHP files in the web root. I ruled any stray PHP a vulnerability. The files were archived and the archive verified before anything was deleted, and two that power the contact form were kept after a check of the build. There is no rollback to WordPress: once a site goes static, the WordPress behind it is gone.

The reason I had left for keeping any site on WordPress was a store plugin for digital downloads on Next Day Videos, a small site with 10 posts, 5 pages and no products. It lasted nine minutes on 08/23/2026, and the site was off WordPress by 08/31/2026.

Watch Search Console after cutover

Google Search Console is where the move shows up. Google's site-move guide says to submit the new sitemap, keep a sitemap of the old URLs so you can watch their indexed count fall, and keep redirects for at least a year, or indefinitely for the sake of visitors. It suggests the URL Inspection tool for single URLs and scripts for many, and Google's HTTP status code reference notes that inspection tools don't follow redirects.

That reference also says all 4xx codes except 429 are treated the same, so 410 rather than 404 buys nothing with Google. We use 410 anyway, because it records a decision in the inventory instead of an accident.

Confirm the property you will watch actually has history before you cut over. On 08/31/2026 the nextdayvideos.com property returned zero rows over 480 days, so "confirm the 301s in Search Console" was a check that could not fail.

Aaron Belchamber

Let my Claude help your Claude

If you want a second pair of eyes on how your own setup uses AI-assisted development, that's what this is: me, personally, for AI specifically. Broader business growth and technology consulting is Brandager's own team.

Book a free 30-minute consult

Researched and drafted with AI, then reviewed and edited by the site's editors.

Filed under