From Wordpress to Hugo, Self Hosting to Github Pages

These past months I realized that my blog, which is made using Wordpress, is very slow and that hurts the traffic. So I went looking for the problems and their solutions but nothing really worked, so I decided to switch everything.
Today I'll talk about that decision, its advantages and disadvantages.

Problems

Huge TTFB

Whenever someone visits https://blog.zhaytam.com, they wouldn't receive the first byte until 4+ seconds later, regardless of whether the page was cached or not, which is HUGE. I suspect that this happens in mobile too, which is a deal breaker for most users.

Suspected reasons:

  • The VPS where I'm hosting the blog is far from where the users are. However this doesn't explain the issue since if you ping the server it responds withing 150ms max.
  • Wordpress takes too long to generate the pages. This can explain the issue, knowing that many plugins are installed and Wordpress is slow by nature.

Bad quality plugins, broken plugins, lots of Ads

There are a lot of Wordpress plugins, some of them are GREAT, others are not so. Sometimes I need a functionality but find a really bad plugin (vote-wise) or an outdated one, which creates this difference of quality between plugins.

Whenever I opened my Wordpress Dashboard I was bombarded by ads from multiple plugins. I get that creators are trying to get sales on their plugins but these types of ads do not go away even if you close them, a good portion of the dashboard is always filled with them unless you close them everytime.

Self hosting costs money

Even though it costs close to nothing (2.99$ per month), for a small blog like mine, it might not even be necessary. So why not save that money for something else?

Switching to Hugo

Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.

I have heard about static site generators for a while, but didn't think they fit my need until I read more about them, especially Hugo. For a blog, this might be the easiest way to get up and going. Depending on themes, you can find anything you need.

What's even better is that you can customize everything yourself as a developper, which is very handy when you need something custom.

To help you switch from Wordpress to Hugo, there is this plugin. One problem (or not, depending on your case) is that it lets other plugins generate content and so you end up with markdown posts that contain html that doesn't respect rules and non-local images.
I spent about 3 days manually cleaning posts and setting up images.

Using Github Pages

I think everyone knows Github Pages by now. You can host a static site in a repository and let people visit it at <username>.github.io or <username>.github.io/<project>.

What I didn't know is that you can replace Github's domain with your own, while enforcing HTTPS! This makes everything easier as I only need to build the blog into a repository and the changes are online.

Everything went smoothly, apart from the HTTPS part. I couldn't enforce it from the Github repository directly and so I'm currently relying on Cloudflare to do so, using Page Rules and their free SSL plan.

Conclusion

I think that this switch was a very good decision. My PageSpeed Insights speed went from a horrible 23 on mobile to 92! I advise every blogger that uses Wordpress to at least consider static site generators as a solution, most don't really need that much functionnality.

Zanid Haytam Written by:

Zanid Haytam is an enthusiastic programmer that enjoys coding, reading code, hunting bugs and writing blog posts.