Got rid of all wordpress blogs

October 23, 2022

I really love simplicity and free of charge services, that on the internet open the door to unlimited use cases i.e. creating websites. That is why I used free web hosts, ftp servers or containers (openshift with free three containers in the past). I have spend shitload of time optimizing it, so it can run for free. Maybe I am focused on it too much, and it would save me lots of time if I would just pay some monthly fee. But I just like the idea that anybody, free of charge can build something beautiful or useful on the internet. And I like the idea that it can run for forever, as no costs are there.

In the reality it can’t run for free for forever, since all of those services have some business plan and people won’t be working for it for free. But there are still more options to run things for free. From servers to databases instances, that are managed. With serverless it’s a game changer, as I hated taking care of infra from the start. I just wanted to have the site working.

But back to the point, I have got rid of all of my WordPress websites. In the past, I used to have maybe 10 or more WordPress websites. But with time, I realized they don’t have any revenue and traffic is lower as well. That inevitably happens if you don’t work actively on your projects. I had a lot of sites like that, that earned enough for me to get by in my students years, but with time I lost interest or found different topics that interest me more.

In the past month, I started receiving notifications, that my WordPress sites are down for a few hours. I have server on VPSfree.cz with 8CPU cores and 4 GB of RAM. It should be enough for WordPress, but mysql was overloading server, and I really didn’t want to go through logs and fixing this (I’ve been using Postgres for past ~7 years). So I decided I will try to move it to statics sites. This blog can be a static site, so does other static page that did not change for a year, but I wanted to have an admin page there for my father to be able to update it once a while. There were some other sites that I realized I won’t be working anymore and there is no need to migrate them to static page. I’ll let them expire.

Tradeoffs

There are some tradeoffs I had to make. Since none of the websites I am talking about make any money, I was willing to make a lot of tradeoffs. One of them is comments - this blog no longer allows comments. I realized not many people comment and this blog was meant more like my diary or notes, so I don’t mind that much. Maybe in the future I will connect disqus.com, but I don’t mind yet. With no comments, I don’t have to install any antispam mechanisms that were required on WordPress.

What I liked on WordPress was shitload of plugins that worked out of the box and had an easy admin page. Like cross-linking, that is added automatically to keywords. Nice links between pages and blogs, links by category or year. This no longer works on my current static site. I didn’t even add pagination yet, and I don’t mind :)

New setup

I wanted to migrate to static site, so I no longer have to care about infrastructure. Having it on my own server was soemthing I wanted to avoid. Luckily as big companies are offering better and better services for free. So I was reading up on cloudflare pages and gitlab pages. I am hosting git repositories of all my websites in gitlab. We use it in company, and I am familiar with it. I’ve also heard we use Gatsby for company’s wiki documentation - so I thought I might use that as well.

On gitlab I created new project, from template I chose Pages/Gatsby. I soon found a github repo with gatsby blog repo. I used that one, which was pretty simple. From this blog, I used their “WP Gatsby Markdown Exporter” plugin to get blogs from wordpress to markdown files. Gitlab CI was setup properly from gitlab template, so I didn’t need to do any changes there. I verified it’s all ok on {blog}.gitlab.io/blog page and was pretty happy how that works out of the box.

In javascript, I did just minor changes, mostly deleting parts of code/content I don’t need. I am not very fond of javascript, but that might change in the future, as I like serverless and might learn more about it. I prefer Python, but I understand it’s a backend technology, and I really like that JS is running on client. In exported articles, I had to fix some encoding and formatting. Over the years, I have had used a lot of plugins for code formatting, images, iframes or videos. I had to update it in markdown manually. Plus remove all unnecessary html code.

That’s basically it. As a last step, I added my own domain to gitlab page and enabled letsencrypt certificates for https. I really love how I have now site hosted all from gitlab with zero monthly cost - except a domain name. I expected I will spend like 10 days with the proces, maybe going through article after article and migrating that. In reality, it was done in a day or two, so that was a very pleasant surprise.


Written by Lucas03 , who uses this as diary. Contact at admin[a]lucas03.com