Author avatar

Scott Bolinger

@scottbolinger

07-29-2019

Why I Moved From WordPress to Gatsby

I got really interested in database-free static websites after interviewing Jack McDade of Statamic on my podcast.

I ended up taking a deep dive into a bunch of frameworks to see what they were all about. Since I have been using WordPress for years, it’s been really fun to see some different technology.

I looked at quite a few static site frameworks, like Jekyll, Statamic, Jigsaw, Gatsby, and Next. All the different technologies got pretty confusing, but I learned a lot about flat-file CMS, and JAMstack.

I ended up moving this site to Gatsby with no backend.

What’s So Great About Static?

My WordPress site was on the cheapest WPEngine plan with no caching plugins or CDN, and I made no effort to optimize it.

I published my new Gatsby site for free on Netlify.

After the move, my site felt way snappier. The speed test on Pingdom didn’t show any significant gains, but I think this is flawed. Just by clicking from page to page quickly it was obvious that the static site was basically instant, and the WordPress site had a visible delay.

The caching for WordPress is really good these days, and my site was not slow before. However, I’m now on free hosting and my site is faster. I have no database to host, or get hacked.

I don’t have a load test tool, but I would assume that with a lot of traffic the speed and lack of server strain would really shine.

One benefit is that I can cancel my paid hosting plan. Since this site doesn’t make any money, that’s kinda nice.

Tired of WordPress

Honestly I’m a bit tired of WordPress right now.

I’m not hating on it, I just need to try something else. I’m not enjoying writing with Gutenberg, I’m sick of cluttered admin notices, slow load times, and the wp-admin behemoth in general.

For my personal sites I just want something simple. Write in markdown and commit to a repo, no cluttered UI, no database.

Pros of Being Database Free

The idea of being database free is exciting for a few reasons:

  • You can commit everything to version control, and push and pull. No database syncing.
  • Everything feels very minimalistic, in a good way. Simplicity is something that’s missing from my WordPress sites.
  • It’s super fast, even on cheap hosting. Static files are not hard to serve quickly.

I like the idea of writing a post in my text editor, then committing it and pushing via git. Modifying templates and site structure by just changing files around locally is a refreshing experience.

Why I Chose Gatsby

After trying lots of frameworks, I settled with Gatsby mostly because I wanted to tinker with React and GraphQL.

There is a static site framework for every language. I didn’t find one that was like “Wow this is the best one by far,” it seemed more like personal preference.

If I wanted to get better with PHP/Laravel, I would have chosen Jigsaw.

Hugo is built with Go, Jekyll with Ruby. They all do similar things, you can choose your code flavor.

I really like Statamic, I’ll probably use that soon. It has the best admin GUI, and it’s perfect for a client that needs an easy way to edit the site and publish content.

Next is a cool option that seems to do really well supporting static and dynamic sites. I’ll dig into that one soon I’m sure.

The frameworks I tested are all pretty easy (for a developer) to use, and they all focus on writing in markdown. They all use some type of build process, YAML, static html files, and no database.

My Experience With Gatsby

I had a lot of fun with Gatsby, but I would not call it easy to setup.

I have experience with modern Javascript frameworks and build tooling, so I had no problem getting started. If you are not already a Javascript developer, this is probably not the thing for you.

Things I Loved

  • Writing in markdown in my text editor then pushing to git is a treat. No GUI to mess with makes writing fun again.
  • I love using Javascript for templating, it’s just where I feel most comfortable.
  • I love Tailwind as a CSS framework. The class-based approach is really fun to work with.
  • GraphQL is really cool

Problems I Had

  • There’s a learning curve. Setting up a simple blog site from scratch was pretty confusing, but if you just use the starter template it’s easy.
  • Images are ridiculously difficult to add to a page. There are several different ways to do it, and they are all stupidly complex. I miss the days of adding a file to a folder, and adding a src url in an image tag.
  • Forms are hard. You can roll your own, add an npm package, or use something like Netlify. I got a MailChimp opt-in going successfully pretty quick. However, I tried for like an hour and couldn’t get a boilerplate contact form to work, maybe I just suck.
  • Extending to support stuff like user management or selling stuff will be a challenge.

One thing is clear - this is not a CMS replacement. It’s a frontend framework. There are CMS backends you can use with it, but I found most of them underwhelming. You can use data from lots of different sources with Gatsby, I’m sticking with no backend for now. If you want a CMS that is not WordPress, I’d recommend Statamic.

The Drawbacks of Static

Static sites are not for every project.

  • You can’t do comments, logins, et al without a 3rd party service or a ton of custom work.
  • Some complex site structures just need a database.
  • Some clients need a rich text editor in the browser, and lots of plugins added to their site.
  • Static sites are still pretty “developery” to setup.

An ecommerce site with hundreds of thousands of products, or a big membership site with complex relationships between users and other data probably won’t work well on a static framework.

Another problem is that some strategies preclude PHP processing. For example, if you are using Gastby, you cannot use a PHP form solution like Gravity Forms without a lot of extra work.

There are some solutions for stuff like login, and commenting, and you can do eCommerce, but if you need all that stuff setup quickly use WordPress.

building products

This blog doesn't use comments, but hit me up on Twitter and start a discussion.