{"id":1007,"slug":"wordpress-to-hugo-migration","title":"WordPress to Hugo Migration","excerpt":"After decades of WordPress pets, swantron.com is now static on Hugo - a fundamental shift to code-first","content":"\u003cp\u003eThis is the first time in decades I haven\u0026rsquo;t had a WordPress instance live. Lordamercy\u0026hellip;\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/uploads/2026/01/delete-wordpress-site.png\" alt=\"Deleting WordPress site - final step\"\n  loading=\"lazy\"\n  decoding=\"async\"\n/\u003e\n\u003c/p\u003e\n\u003ch2 id=\"wp-trucker-logs-from-shared-hosting-to-code-first\"\u003eWP Trucker Logs: From Shared Hosting to Code-First\u003c/h2\u003e\n\u003cp\u003eOver two decades, swantron.com hopped through several hosting trends:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003ePhase 1: Classic\u003c/strong\u003e – Traditional shared hosting (Siteground)\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003ePhase 2: Cloud Ops\u003c/strong\u003e – VMs \u0026amp; DBs (EC2 \u0026amp; RDS / GAE \u0026amp; not RDS)\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003ePhase 3: IaC-adjacent\u003c/strong\u003e – Dockerized one-click pets (GCP, but mostly DigitalOcean)\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003ePhase 4: The End State\u003c/strong\u003e – Static delivery via Hugo + GitHub Actions\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eEach previous phase was just a different way of babysitting a server. This one\u0026rsquo;s a different kind of change: from \u0026lsquo;managed system\u0026rsquo; to \u003cstrong\u003ecode-first delivery.\u003c/strong\u003e\u003c/p\u003e\n\u003ch2 id=\"the-database-horror-the-lordamercy\"\u003eThe Database Horror (The Lordamercy)\u003c/h2\u003e\n\u003cp\u003eI had a shower thought about how gross a WordPress database might end up after being left out in the rain for \u003cstrong\u003e20 years\u003c/strong\u003e (2005-2025). I finally checked. My final database dump: \u003cstrong\u003e34MB and 555,947 lines of text.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/uploads/2026/01/sql-file-size.png\" alt=\"SQL file size - 555,947 lines\"\n  loading=\"lazy\"\n  decoding=\"async\"\n/\u003e\n\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003e122,307 references\u003c/strong\u003e to \u003ccode\u003ebouncerblog.com\u003c/code\u003e.. a domain that died over a decade ago.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eSerialized PHP arrays\u003c/strong\u003e stored as strings. Want to change a simple rewrite rule? Nope.  Good luck parsing a 2,000-character string in \u003ccode\u003ewp_options\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eZombie Data:\u003c/strong\u003e Thousands of \u003ccode\u003e_transient\u003c/code\u003e entries and orphaned plugin settings that WordPress autoloads on every single page request, long after the plugins are deleted.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe database had become a dumpster fire. Transitioning to Markdown files is nice. No more regex-searching a SQL dump just to find a setting.\u003c/p\u003e\n\u003ch2 id=\"the-migration-the-1040-post-slugs\"\u003eThe Migration (The 1,040 Post-Slugs)\u003c/h2\u003e\n\u003cp\u003eMoving \u003cstrong\u003e1,040 posts\u003c/strong\u003e is a special kind of hell. The goal was to strip away the ugly legacy \u003ccode\u003e/index.php/\u003c/code\u003e prefix from my URLs without breaking 20 years of external links and search indexing.\u003c/p\u003e\n\u003cp\u003eI wrote some dirty Python to automate the \u003ccode\u003ealias\u003c/code\u003e field in Hugo\u0026rsquo;s spec to map the shitty legacy paths to the new clean ones.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eThe result in each Markdown file:\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;\"\u003e\u003ccode class=\"language-yaml\" data-lang=\"yaml\"\u003e\u003cspan style=\"display:flex;\"\u003e\u003cspan\u003e\u003cspan style=\"color:#f92672\"\u003etitle\u003c/span\u003e: \u003cspan style=\"color:#e6db74\"\u003e\u0026#34;This Old Post about Hot Sauce\u0026#34;\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display:flex;\"\u003e\u003cspan\u003e\u003cspan style=\"color:#f92672\"\u003eslug\u003c/span\u003e: \u003cspan style=\"color:#e6db74\"\u003e\u0026#34;this-old-post-about-hot-sauce\u0026#34;\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display:flex;\"\u003e\u003cspan\u003e\u003cspan style=\"color:#f92672\"\u003ealiases\u003c/span\u003e:\n\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display:flex;\"\u003e\u003cspan\u003e  - \u003cspan style=\"color:#ae81ff\"\u003e/index.php/2005/10/10/this-old-post-about-hot-sauce/\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003e\u003cimg src=\"/uploads/2026/01/alias-example.png\" alt=\"Alias example in frontmatter\"\n  loading=\"lazy\"\n  decoding=\"async\"\n/\u003e\n\u003c/p\u003e\n\u003cp\u003eSuper straightforward. Hugo generates redirect HTML pages at the old paths during the build. This preserves every bookmark (yeah right), share, and search result while allowing the site to live at a modern URL.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eResult: 1,041/1,041 posts migrated with 100% link integrity.\u003c/strong\u003e\u003c/p\u003e\n\u003ch2 id=\"the-new-stack\"\u003eThe New Stack\u003c/h2\u003e\n\u003cp\u003e\u003cstrong\u003eHugo 0.154.5\u003c/strong\u003e for static generation, \u003cstrong\u003eGitHub Pages + Actions\u003c/strong\u003e for hosting and CI/CD. No themes.. just custom CSS and layout code that I control entirely.  No comments, because I\u0026rsquo;m not collecting feedback from blog commentators.\u003c/p\u003e\n\u003ch3 id=\"the-tipping-point\"\u003eThe Tipping Point\u003c/h3\u003e\n\u003ctable\u003e\n\t\u003cthead\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\t\u003cth\u003eFeature\u003c/th\u003e\n\t\t\t\t\t\u003cth\u003eWordPress\u003c/th\u003e\n\t\t\t\t\t\u003cth\u003eHugo\u003c/th\u003e\n\t\t\t\u003c/tr\u003e\n\t\u003c/thead\u003e\n\t\u003ctbody\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eSpeed\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e2s - 4s Load\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003e\u0026lt; 500ms\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eSecurity\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003eConstant Patches\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eZero Attack Surface\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eCost\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003eMonthly Fees\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003e$0 (GitHub Pages)\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eURL Structure\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e\u003ccode\u003e/index.php/slug\u003c/code\u003e\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eSane\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\t\t\u003ctr\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eContent\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003eMySQL\u003c/td\u003e\n\t\t\t\t\t\u003ctd\u003e\u003cstrong\u003eMarkdown / Git\u003c/strong\u003e\u003c/td\u003e\n\t\t\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2 id=\"why-this-matters\"\u003eWhy This Matters\u003c/h2\u003e\n\u003cp\u003eI write Markdown, I \u003ccode\u003egit push\u003c/code\u003e, and it\u0026rsquo;s live.\u003c/p\u003e\n\u003cp\u003eIt feels like the OG blogging days again. We had CMS shit back then, but blogging was largely just writing and publishing. Simple and direct. SEO made things weird for a bit (paid posts\u0026hellip; did that) and we tried to mash PHP junk onto all sorts of places for no particular reason. The CMS never really got better, and blogs sort of died under their own weight.\u003c/p\u003e\n\u003cp\u003eIn a way, I\u0026rsquo;m jumping back in with the terminal Gs who never bothered down this path in the first place. They\u0026rsquo;ve been over there in their minimal setups, posting random shit about obsolete tech this entire time, while the rest of us were fighting database corruption.\u003c/p\u003e\n\u003cimg src=\"/uploads/2026/01/cowbot.png\" alt=\"Cowbot - The migration buckaroo\" class=\"cowbot-image\" /\u003e\n\u003cp\u003eHere\u0026rsquo;s to another decade, though\u0026hellip; this time it is static, versioned, and finally \u003cstrong\u003ecattle, not pets.\u003c/strong\u003e\u003c/p\u003e\n","date":"2026-01-18T05:00:00Z","permalink":"https://swantron.com/2026/01/18/wordpress-to-hugo-migration/","link":"https://swantron.com/2026/01/18/wordpress-to-hugo-migration/","path":"/2026/01/18/wordpress-to-hugo-migration/","featuredImage":"/uploads/2026/01/cowbot.png","categories":[],"tags":[]}