NewsCrawler.org

Moving a 10-year WordPress blog to Astro and Cloudflare Workers

脱WordPress:Astro + Cloudflare Workersへ10年超の個人ブログを移行した
新しいブログの構成。Markdown と Sveltia CMS で書いた記事を GitHub に置き、Astro と Pagefind でビルドして wrangler で Cloudflare にデプロイする。Cloudflare では Workers Static Assets、独自ドメインと DNS、旧 URL の転送を受け持ち、画像は R2 と既存ストレージから返す
Cloudflare の「サイトを追加」画面。「ドメインを接続」「ドメインを転送」「ドメインを購入」の 3 つの選択肢のうち「ドメインを接続」を選ぶ
Cloudflare のネームサーバー変更の案内。割り当てられた 2 つの Cloudflare ネームサーバーを追加し、旧レンタルサーバーのネームサーバー 5 つを削除するよう指示されている
Image: zenn.dev

The author moved a personal blog that had run on WordPress for more than 10 years to a static site built with Astro, a static site generator[1], and served by Cloudflare Workers. The immediate reason was a PHP vulnerability published in October 2026 that could allow a remote third party to run arbitrary code. The author had not maintained the blog for a long time, and the goals were to run no server-side programs, expose no admin panel, and reduce update work.

About 2,000 articles were converted from a WordPress WXR[2] export into HTML files, and all URLs were kept unchanged. The Worker handles only redirects of old URLs, images under /wp/*, and a management API under /api/*; all other requests return static files. The roughly 30,000 images are being moved from R2 gradually, with the existing storage used as a fallback, rather than all before launch.

The production switch was made by deleting the A record[3] and assigning the custom domain to the Worker, and the site was not displayed for about 40 seconds. Deferred loading of external scripts and Cloudflare image transformation raised the PageSpeed Insights mobile score from 66 to 100. Claude ran the git, DNS and wrangler[4] deploy steps, while a human had to approve the production deploy. The migration work itself took one day.

Read the original zenn.dev

Sources

  • Zenn JA

    脱WordPress:10年超の個人ブログをAstro + Cloudflare Workersへ移行しPageSpeed 100点を実現

    51 likes25 bookmarks0 comments

Published: First seen: Читать по-русски

Open as a page