For years, I’ve been fascinated by the idea of making WordPress lighter, faster, and less dependent on the traditional MySQL/MariaDB stack. The promise of SQLite is compelling: a flat-file database, no server overhead, and the potential for blazing fast performance. On paper, it sounds perfect—especially for small to mid-sized sites, or self-hosted setups where simplicity matters.
But getting SQLite to play nicely with WordPress turned out to be anything but simple.
The Long Road of Trial and Error
At first, I went down the “direct integration” path—replacing the database layer manually, editing wp-config.php, dropping custom db.php files into place, and attempting to wire everything together by hand.
It worked… sometimes. Other times, it broke spectacularly.
Permissions weren’t right.
Shard files weren’t attaching.
Plugins would attempt queries that SQLite didn’t understand.
The dreaded “Unknown query type: PRAGMA” messages filled error logs.
Each attempt felt like one step forward, two steps back. I’d fix one issue, only to hit another. What should have been a simple experiment became an exercise in persistence.
The Moment of Clarity
After far too many late nights, log dives, and container rebuilds, the breakthrough came when I switched focus back to the plugin approach.
Instead of bending WordPress core to my will, I leaned into the ecosystem:
A dedicated SQLite integration plugin that handled the translation layer.
A sharding system built into the plugin, so I didn’t need to manage file attachments manually.
A settings interface that made adjustments possible without cracking open the code every time.
It was almost humbling. Once the plugin was in place, everything just… worked. Tables appeared where they should. Queries executed cleanly. The admin panel loaded with the kind of speed that reminds you why SQLite is worth the effort in the first place.
Looking Back: Frustration to Relief
If there’s one lesson I take away from this, it’s that WordPress works best when you extend it the “WordPress way.” Fighting core files and patching around limitations was nothing but a time sink.
But the plugin route?
It respected the WordPress structure.
It kept upgrades safe.
It abstracted the pain points away.
And once it was set up, the payoff was huge—fast, reliable, lightweight WordPress running on SQLite shards with zero database server overhead.
Final Thoughts
This project reminded me that the shortest path isn’t always the easiest. What felt like the “direct” solution (rewriting WordPress to force SQLite support) ended up being a rabbit hole of frustration. Returning to the plugin mindset, however, unlocked the stability and performance I’d been chasing from the start.
If you’re looking at SQLite for WordPress: save yourself the frustration. Start with a plugin. You’ll still need patience, but once it’s all done and dusted, you’ll wonder why you ever tried to do it any other way.