Skip to content
Hexo vs WordPress: The difference isn't speed, but when failures occur

Hexo vs. WordPress: The difference isn't speed, but when failures happen

When choosing a blog system, people compare the same things: load speed, number of themes, plugin ecosystem, ease of setup. All of these can be looked up and demonstrated. But they don’t explain one thing: why some people have used WordPress for eight years without a single incident, while others find static sites more exhausting after switching.

The real dividing line is rendering timing. WordPress assembles pages on every request; Hexo assembles pages on every publish. The former puts complexity at the moment a reader opens the page; the latter puts it at the moment you hit publish. Which moment you’d rather handle failures at basically determines which one you should choose.

I wrote about the personal-choice part elsewhere: In the end I chose Hexo. This post is just the engineering ledger, with data from this site at the time of writing: 172 posts, 1008 build artifacts, 31MB.

Two pipelines, failures in different places

A single WordPress page request goes through nginx, PHP-FPM, WordPress, MySQL, and the theme template before it finally emits HTML. Hexo has no such pipeline; Markdown becomes files at build time, and nginx reads the files directly.

Laying out both pipelines, the difference is which link needs someone on duty:

flowchart LR
  subgraph WP["WordPress 请求期"]
    direction LR
    A[读者请求] --> B[nginx]
    B --> C[PHP + WordPress]
    C --> D[(MySQL)]
    C --> E[HTML]
  end
  subgraph HX["Hexo 构建期"]
    direction LR
    M[Markdown] --> N[构建]
    N --> O[HTML 文件]
    R[读者请求] --> S[nginx]
    S --> O
  end

A static site isn’t “one layer less”—that layer simply doesn’t exist at request time. Page caching, object caching, database connection pools—these terms have no counterpart in a static site’s runtime.

The cost is equally direct: any feature that needs to “remember something” must be decided in advance where to put it.

Failure WordPress Hexo
Template typo Readers see a white screen or 500 Build fails, production keeps the old version
Incompatible plugin upgrade May break only one page Not applicable
Database connection failure Whole site 500 Not applicable
Disk full Uploads fail, session writes fail Deploy fails, old version still there
Dependency upgrade Plugins and PHP versions constrain each other Lockfile pins versions, failures can roll back

The key difference isn’t “static is faster”—it’s when failures happen. Static site publishing is usually all-or-nothing: if the build fails, nothing goes live. WordPress failures often appear only in production, and only affect some pages, so troubleshooting also requires distinguishing theme, plugin, and cache.

Content model: files vs. database

WordPress puts posts in wp_posts, extra information in wp_postmeta, site configuration in wp_options, and images in uploads. This structure extends well; plugins can always find a place to store whatever they need.

The cost is migration. The official export is WXR XML, with shortcodes, block comments, and plugin custom fields mixed into the body. When switching systems you can take the text but not the structure. Backups also split in two: one for the database, one for uploads, and versions must match on restore.

On the Hexo side, a post is just a Markdown file, with version history in git. What changed—git diff shows it directly; to review just one post, commit just that one file. Backup is git clone, migration is copying the directory. To batch-change titles or links, grep plus sed is enough.

This site’s 172 posts correspond to 172 Markdown files, 10MB of covers, and 1008 build artifacts totaling 31MB. The whole site’s recoverability equals one repository.

What it gives up is WYSIWYG. Tables, footnotes, image alignment—all must be confirmed via local preview. For people who write code this isn’t a problem; for authors who don’t touch the command line it’s a hard barrier.

Build cost is a linear curve

I just ran a clean build: 172 posts, 2.65 seconds, including cover validation and Pagefind indexing. This number easily leads people to underestimate cost, because it only counts generation, not image processing and deployment.

Hexo builds everything; there’s no truly reliable incremental mode. Post count grows linearly, but the constant is small. At this ratio, the thousand-post scale is usually still in the tens of seconds. The bottleneck is generally not template rendering but two places: images must be read and resized one by one, and the search index must be re-tokenized.

Where it really starts to hurt is thousands of posts with multiple publishes per day. Then full builds slow iteration, and the common solutions are splitting the site, moving image processing out of the main build, or switching to a stronger machine—not finding a plugin that claims to be incremental. Most incremental schemes break after template or plugin changes, and the time saved isn’t enough to troubleshoot them.

WordPress’s cost curve is the opposite: a single request has little to do with total post count, thanks to indexes; but every request goes through PHP and the database. The more posts and the more traffic, the more important caching and query optimization become.

In one sentence: static sites pay a fixed cost for publishing, dynamic sites pay a variable cost for visiting. A personal blog publishes little and gets little traffic, so fixed cost is easier to control; high-frequency publishing, heavy traffic, and strong dynamics make variable cost easier to scale horizontally.

Search: index generated at build time

This site uses Pagefind, which indexes all body text at build time—about 4MB for 172 posts, loaded in shards. It has no server, so query cost is zero; the downside is the index ships with each publish, and Chinese tokenization and relevance lag behind dedicated systems like Elasticsearch.

Here’s a real pitfall. Hashed index shards have content that never changes, so they can be cached long-term; the entry file pagefind-entry.json has no hash, so if you give it a long cache, readers must wait for the cache to expire before they can find new posts. This site previously set it to 30 days, then changed it to 5 minutes, while hashed shards still keep a one-year cache.

NGINX7 lines
1
2
3
4
5
6
7
location = /pagefind/pagefind-entry.json {
add_header Cache-Control "public, max-age=300";
}

location ^~ /pagefind/index/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}

WordPress’s default search goes through MySQL’s LIKE, which slows noticeably as posts grow; for quality you hook up Elasticsearch or Meilisearch, at the cost of an extra always-on service and a set of index-sync logic.

The criterion is simple: if search is just “finding that post I wrote,” Pagefind is enough; if search itself is a product feature, a static approach doesn’t fit.

Dynamic capabilities: bolt-ons work, but stitching them together is another matter

Comments are the most typical example. WordPress has built-in comments, with mature solutions for moderation, notifications, and anti-spam, and data in your own database. Static sites generally use Giscus or utterances, parking comments in GitHub Discussions; readers must log in to GitHub, and access from mainland China is unstable. This site simply turned comments off and uses email instead.

Membership and paid content are even more obvious. WordPress plus WooCommerce or a membership plugin is a mature path, with accounts, orders, and permissions all in one system. Static sites can only put payment externally, with the site doing display and redirects. It runs, but the product experience is stitched together.

Forms can be handed off to Formspree or a self-built serverless setup; A/B testing and personalization require edge computing, where static sites have no advantage.

So the boundary is clear: when content is the product, static fits; when content is just the entry point and accounts and transactions follow, WordPress is less hassle. Forcing the latter into a static setup doesn’t make the complexity disappear—it just comes back in a more awkward form.

Images are the overlooked big cost

This site has 172 cover images at 1600×900, totaling 10MB. The homepage lists 20 posts at once, so images come to about 1.1MB, while the actual display width is only around 400. This is the most common performance hole in static blogs: the generator only puts images on the page, it doesn’t manage how much the browser has to download.

WordPress is more worry-free here—it auto-generates multiple sizes on upload, and themes pick one with srcset. The cost is that uploads keeps growing, plugin quality varies, and thumbnail strategy still needs a human.

The right approach for a static site is to generate 400, 800, and 1600 variants at build time, write both srcset and width/height in the template, and prefer WebP or AVIF. Don’t expect the CDN to solve this—a CDN only optimizes transfer, it doesn’t change decoding or memory usage.

Another easily overlooked cost is binary files in the repo. This site has a 5.7MB PDF that gets uploaded on every publish. At low traffic it doesn’t matter; once traffic picks up, such files should move to object storage.

Security, backups, and cost

Scanners don’t distinguish targets. This site received 9,338 404s in 6 days, 55.6% of all requests, among which wp-login.php, .env, .git/config, and xmlrpc.php are all common entry points from the WordPress era. On a static site these requests never even reach PHP—nginx just checks for a nonexistent file; on WordPress, wp-login.php is a real endpoint, and xmlrpc.php can even be used for amplification attacks.

The difference in backups and upgrades is just as real:

  • Static site: git clone is the full backup, and restore time depends on network speed; upgrades depend on changing the lockfile, and a failed build can be rolled back.
  • WordPress: database plus uploads plus plugin versions, and restore requires version matching; an upgrade is a compatibility test, and the more plugins, the more combinations.

On cost, a 2C2G machine running a static site has plenty of headroom, because each request just reads a file; the same config running WordPress needs to reserve resident memory for PHP-FPM processes and the database. CI’s free tier is more than enough for a few publishes a day.

There’s also a deployment detail that’s often ignored: rsync --delete is not atomic. With many files, readers may see a mix of old and new files. The more robust approach is to publish to releases/<sha>/ and switch via a symlink; rollback means pointing the link back to the previous directory.

BASH1 line
1
ln -sfn /var/www/releases/20261117-1 /var/www/current

Rolling back a static site is simpler than WordPress, because code and content live in the same commit.

When WordPress is clearly better

  • The author doesn’t write Markdown and doesn’t want to touch git.
  • Multi-person collaboration requiring roles and permissions.
  • Membership, paid content, courses, or e-commerce.
  • Frequent redesigns, without wanting to run a build every time a template changes.
  • Dependence on a plugin that only exists for WordPress.

These aren’t technical debt—they’re real requirements. Forcing them onto a static site usually ends with a WordPress that’s harder to maintain.

The pitfalls you’ll actually hit during migration

  1. URL structure. WordPress commonly uses /2024/05/slug/, while Hexo defaults to including the date. Changing the permalink means changing links, so you must do 301 mappings—don’t expect search engines to guess.
  2. Image paths. wp-content/uploads must be moved wholesale, and links in the body text rewritten.
  3. Comments. Most approaches can only freeze or discard them—decide in advance, don’t discover this after launch.
  4. RSS. Long-time readers are subscribed to /feed; at minimum give it a 301 to /atom.xml.
  5. Cache headers. Short cache for HTML, long cache for hashed static assets, and handle the search entry separately.
  6. Verification. After publishing, curl each old link one by one to confirm where the 301 lands—don’t just check that the homepage returns 200.

Answer six questions before choosing

  • Do you write Markdown?
  • Do readers need to log in, pay, or comment?
  • How many times a year do you change the theme?
  • Can you accept “build fails before publish”?
  • Will you have more than a thousand posts?
  • Would you rather maintain a server, or maintain an admin panel?

If the first three lean toward “yes, need, often,” choose WordPress; if they lean toward “no, don’t need, rarely,” static generation is less hassle. The remaining questions determine the scale ceiling, not the direction.

The cost of tool choice isn’t on day one—it’s after a hundred publishes. On day one both run fine; by the hundredth, one asks you to click upgrade, the other just asks you to commit. Choose the tool you’re still willing to open after a hundred times.

About this Post

This post is written by Lu's Blog, licensed under CC BY-NC 4.0.

#Blog Setup #Hexo #Static Sites #WordPress

Comments