HIRO GEAR
自作インフラ Astro WordPress Web開発

Complete Migration from WordPress to Astro: Abandoning PHP Vulnerabilities and Heavy CMS for an AI-Collaborative, Ultra-Lightweight Blog

Complete Migration from WordPress to Astro: Abandoning PHP Vulnerabilities and Heavy CMS for an AI-Collaborative, Ultra-Lightweight Blog

I have been running a blog on my home Raspberry Pi server using WordPress with Docker containers for quite some time.

However, as the site grew in scale and its integration with Obsidian (my flagship tool for daily intellectual production) and custom AI agents advanced, the “sense of dissonance” and “operational stress” associated with traditional, heavy dynamic CMS platforms became unbearable.

This time, I have completely graduated from WordPress and fully migrated to Astro, a modern Static Site Generator (SSG).

In this article, I will document why I abandoned the world’s most popular WordPress, what challenges Astro solved for me, and outline the new blog operation design for co-creating with AI agents.


1. Three Fundamental Reasons for Graduating from WordPress

WordPress is wonderful software used worldwide, but for me, who wants to smartly record and broadcast my thoughts and skills, it gradually became over-specified and a burden.

① “Structural Vulnerability Anxiety” of PHP and Databases

WordPress is a “dynamic CMS” where PHP runs on every access, pulls article data from the MariaDB/MySQL database, and assembles HTML. Furthermore, since the admin panel (/wp-login.php) is exposed to the outside world, it continues to be targeted by brute-force attacks (dictionary attacks) and vulnerability scans from bots around the globe.

I just wanted to run my personal blog peacefully, but being chased by regular plugin updates, core updates, and database integrity checks was bad for mental health. The thought that “if I simply don’t run PHP or a DB on the server, wouldn’t the gap for attacks disappear?” became increasingly strong.

② Complexity of Backups and Difficulty of Restoration

Backing up WordPress is surprisingly troublesome.

  • MySQL database dump (.sql) containing articles and settings
  • Uploaded image groups (/wp-content/uploads/)

These two streams must be saved while maintaining consistency, and restoring the system in case of a server crash is labor-intensive. It was far from the simplicity of “copying and pasting a few files to restore everything.”

③ Realization that “This Level of Complexity is Unnecessary”

The complex styling of the Block Editor (Gutenberg), heavy JavaScript, and bloated CSS. What I needed was “minimalist beauty that can be read instantly without stress on both PC and smartphone,” not a forest of luxurious plugins.


2. Why Astro? — Minimal HTML/CSS and Overwhelming Freedom

There are many choices for Static Site Generators, such as Hugo or Next.js, but the deciding factors for choosing Astro were the following three points.

① “Grow to Your Own Taste” with Pure HTML/CSS/Tailwind

Many CMSs and modern frontends are often bound by framework-specific black-box practices. However, Astro allows you to assemble components using raw HTML and CSS (Tailwind CSS) as they intuitively feel. I was able to implement my unique aesthetic—such as a “warm background feeling like washi paper” or an “elegant grid of celestial star charts”—with minimal CSS exactly as I envisioned.

② “Substantially Zero Client-Side JS” via Island Architecture

Astro’s biggest feature is that it does not send any client-side JavaScript to the browser by default. Only pure HTML and CSS are generated. Therefore, initial page loads and screen transitions complete with an otherworldly speed of 1ms~5ms (perceived as zero seconds).

③ Robust Type Safety via Markdown / Content Collections

All articles are managed as plain Markdown files (.md) locally. With TypeScript schema definitions (Zod), tag formats, publication dates, and missing specifications for featured images are automatically validated at build time, ensuring article quality is always high.


3. The New Architecture Built for Deployment (Cloudflare Tunnel × Nginx Static Delivery)

The overall configuration for public deployment built during the migration is as follows.

flowchart TD
    subgraph Client ["Reader / Viewing Environment"]
        Browser["Browser (PC / Smartphone)"]
    end

    subgraph Raspi ["Raspberry Pi Home Server"]
        Nginx["Nginx (Port 80)"]
        Dist["/data/hiro-gear-astro/dist/<br>(Ultra-lightweight static HTML & assets)"]
        Tunnel["Cloudflare Tunnel (cloudflared)"]
    end

    Browser -->|https://hiro-gear.com| CF["Cloudflare Edge"]
    CF <-->|Encrypted Tunnel| Tunnel
    Tunnel <-->|Local Forwarding| Nginx
    Nginx -->|Zero-overhead direct delivery| Dist
  • Complete static delivery without even needing Node.js to be resident: We adopted a configuration where Nginx directly delivers the static file group generated by npm run build. This results in 0% CPU load and 0MB memory consumption for blog delivery. By stopping the WordPress container and database, approximately 1GB of free memory was instantly released on the Raspberry Pi.

4. New Operation: Teaching “Blog Operation Rules” to AI Agents

The biggest harvest from this migration was establishing a “blog operation flow co-created with AI agents.”

We stopped the style of humans clicking around in the WordPress admin panel and instead thoroughly taught the following four major rules as skills (knowledge) to the AI agent.

Rule ItemSpecific Regulations
Unified TaggingAbolished the traditional “Categories” and unified them into 4 axes directly connected to my vision (Custom Infrastructure / AI & Agents / Planner / Intellectual Production / Life & Daily Work) + individual technology tags (2-3 items).
Structured Table of ContentsLimited to H2/H3 two levels. Headings are constructed with specific phrases that convey the main points.
Thumbnail Unification16:9 horizontal wide format. Fixed a prompt type maintaining the worldview of Wabi-sabi × Celestial Star Charts × Tech, and no text inside images.
Privacy FirewallCompletely strip Exif location information from images using Pillow. Exposure of license plates, living areas, home interior IPs, and equipment names is strictly prohibited.

By creating draft articles from daily thought notes (Obsidian) and instructing the AI agent to “edit this article, generate an image for the featured image, and publish it,” a system was established where highest-quality articles fully complying with rules are deployed in just a few minutes.


5. Dramatic Evolution of Backup Plan — Into a World Where “Git is Everything”

The backups that worried me during the WordPress era have become incredibly simple.

  • Git Repository is the Backup Itself: Article content (Markdown), image assets, site design code, and build settings are all consolidated in a single Git repository (/data/hiro-gear-astro).
  • Double Backup to Another Machine with One Command: After writing an article, just git commit and git push to the development workstation.
  • Disaster Recovery Restorable in 1 Minute: Even if the Raspberry Pi is physically completely lost, cloning with git clone on new hardware and running npm run build brings back a 100% identical blog in just 1 minute. The days of worrying about database restoration and permission adjustments are completely gone.

6. Conclusion: Subtraction Created a Place to Focus on Thinking

The migration from WordPress to Astro was not merely switching web frameworks, but rather “subtraction to let go of unnecessary complexity and focus on truly important content and contemplation.”

  • Security: No PHP, no DB, no login screen means zero anxiety about vulnerabilities.
  • Performance: Page display is in milliseconds. Extremely comfortable on both mobile and PC.
  • Maintainability: Complete with just files and Git; backups and restoration are incredibly easy.
  • Scalability: Linked with AI agents, completing the writing and publishing flow directly from the planner (Obsidian).

For those who think “I want a simple blog that I can control on my own server” or “I want to create a smart exit for intellectual production suitable for the AI era,” I am convinced that a static site configuration using Astro and Markdown is undoubtedly one of the most beautiful and strongest choices available right now.