After running this blog for over two decades, it was time for some serious housekeeping. I converted from WordPress to Hugo some years ago, but never had time to do a proper cleanup. Then, the focus was on conversion and making it work.
Now, with the help of GitHub Copilot, I finally got around to cleaning up the technical debt that had accumulated across several thousand posts.
The Scale of the Challenge
This blog currently contains more than 2000 English posts and 200 Norwegian posts, spanning from 2000 to 2025. In the beginning, I wrote HTML code manually, then moved on to server-side includes, then to WordPress, and now to Hugo. Throughout those years, I have changed themes and explored new web standards as they have evolved. That history shows in the inconsistencies that have built up in the content.
What Got Fixed
1. Missing/incomplete Tagging
The most significant task was adding tags to all posts that lacked them. This included adding tags to a hundred untagged posts from before 2008. Fortunately, CoPilot assisted in reading through the posts and suggesting meaningful tags. My tag list is still too long, though, so I will need to clean it up properly another time.
2. Modernizing YouTube/Vimeo Embeds
Many older posts contained deprecated Flash-based video embeds using <object> and <embed> tags. These haven’t worked since Flash was discontinued in 2020, so it was time to get rid of them and convert to modern <iframe> embeds instead:
<iframe width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
3. Front Matter Consistency
Hugo is case-sensitive about the draft field. CoPilot found several posts using Draft: True instead of the correct draft: true, which could cause them to be published accidentally. It also helped identify posts with empty descriptions that contained substantive content but lacked metadata.
4. Cleaned Up Short Posts
Back in the days, I often used the blog to publish two-sentence posts that nowadays would go into a social media channel instead. So I have deleted a bunch of the shortest ones, but have kept some that are more interesting for historical reasons.
5. Removed Orphaned Images
WordPress made a bunch of image files at different resolutions that are no longer needed. So I had CoPilot make a script for me that checked for all unused image files. This helped remove around 3,000 unused images that were taking up server space. In the process, I also managed to link up some files (photos, videos, zip, and PDF) that, for some reason, had the wrong pointers.
6. Removed other oddities
I realize how many strange things WordPress puts into my posts, including some Zemanta-pixie trackers that now appear in many of them. Fortunately, it is all gone now.
7. Hiding Descriptions from Posts
The PaperMod theme I use displays front-matter descriptions at the top of each post. While useful for SEO and social media previews, I found it redundant to show them on the actual post pages. I created a custom layout override to hide them while preserving them for meta tags, RSS feeds, and social sharing.
Technical Approach
I would never have been able to get all of this done in just a couple of hours without CoPilot. We worked together systematically, though. It created Python scripts to search for various things in posts and suggested fixes. Some I did manually, and others it helped with batch processing. To avoid big problems, I routinely built and pushed new versions of the blog to the server.
Lessons Learned
AI-based tools have their limitations, but for this type of work, tedious cleanups of technical issues in a large blog, they really helped. I have removed a lot of old web tech that cluttered my 25-year-old blog, making it easier to run for 25 more years!
Thanks to CoPilot for help with the cleanup and for writing the first draft of this post.
