Photo from unsplash

Why I switched from WordPress to Gatsby

August 22, 2019 at 08:23 PM EDT

WordPress is a pretty good blogging platform. It's got a lot of power and capability, and what you can do with it is just about endless. I even use it professionally.

But here, all that power is more of a hinderance than a help. I wanted something custom that I could build into, and I wanted something that's a little less blog-oriented, since I don't post a huge amount. And since I also use React professionally, and really like it, I was comfortable building it there.

So, a couple months ago, I started converting the site to Gatsby, one of the more popular static site generators, and purchased and adapted a template to make it how I wanted.

Site Speed

Here's the difference between WordPress and Gatsby. WordPress is a server-based content management system (CMS). So when you visited a page on my WordPress blog, the server gathered all the content and built the page for you essentially from scratch. But that means that when I save a post, it's available almost instantly, since the server can just make the page for you when you visit it.

Gatsby, as I said, is a static site generator, so the process of building the page happens earlier - when I actually save the post. Then, the finished product goes to the server, which doesn't have to do much to show you the page. That means it takes a couple of minutes to regenerate whenever I make a change. But then the page is available instantly, and instead of having a single server somewhere that runs my code, I literally have a network of computers around the world that just serve those files.

Site Structure

I also didn't want the blog to be the center of this site. It's more of a hub that points to my different work. While WordPress is primarily a blog platform, it was certainly possible to build this site on it. But that's a lot more infrastructure around it. Building a custom page like my homepage would require more complicated coding than just putting together some React components, which I find easier.

WordPress' Gutenberg project would have made it easier to build those components for that platform, but that would still have taken more work than the React and GraphQL functionality offered by Gatsby.

Infrastructure

WordPress has some specific-ish requirements: a server running PHP and a web host (like Apache or nginx), and a MySQL or MySQL-like database. If either of those go down, the site goes down. It's also hard to move — it took me a weekend to move from my semi-reliable but cheap hosting service to a more-reliable but costlier server, and that's without adding any functionality.

Gatsby's requirements are simpler. It's possible for me to generate the site on my laptop and simply push it up to whatever service I choose, or have any of a number of services do that for me. Netlify, the service I use to host this right now, does that for me. But if I wanted to move, it's a matter of an hour, not a weekend.

Consistency

For my writing projects, I've been developing microsites (see, for example, directorate51.com). Since those definitely don't need the power of WordPress, I'm able to build them very quickly and easily with Gatsby. So keeping it all in the same platform makes it easier to use them all.

Fun

Most of all, I selected Gatsby as a matter of fun. While I use both WordPress and React at work, I found myself really enjoying playing with different parts of React at home, and the way I'm using it is significantly different than how I'm using it at work.

© 2016-23 Todd Dukart

Made in Massachusetts with Chakra UI and Gatsby.