From Shortcodes to Blocks: A Small WordPress Victory

Every so often, I find myself hunting for a WordPress plugin that can filter a tag cloud by category and/or tag. Over the years, I’ve tried a lot of them. One wanted to filter by page template. Another required me to prefix tags into their own artificial “namespaces.” Most were clever in theory and awkward in practice.

Eventually, I got tired of trying to bend my content to fit someone else’s assumptions. It started to feel like the plugin I wanted simply didn’t exist.

I’ve never developed a WordPress plugin before. In fact, I wouldn’t even say I knew how to start, other than looking at examples. But curiosity won out, and I decided to give it a shot anyway. Enter what people are now calling vibe coding.

I started by working back and forth with Google Gemini, which got me surprisingly far. I was able to revive an old shortcode-based solution, and for a moment, it felt like I was done. Then I ran headfirst into Gutenberg.

At first, I thought Gutenberg was just a historical reference — the first Bible printed with movable type, or Project Gutenberg’s massive archive of public-domain text files. As it turns out, Gutenberg is also WordPress’s “newish” block editor. The old editor was a traditional WYSIWYG interface that worked directly with HTML. Gutenberg, by contrast, treats everything as structured blocks of content.

And honestly? Getting Gutenberg to cooperate was a pain.

This is where things shifted. I handed my plugin file over to ChatGPT, and it took me the rest of the way. It wasn’t effortless — I still hit walls and had to reason through what was happening — but it kept moving forward. Where Gemini tended to repeat itself or insist the problem was me, ChatGPT was better at recognizing that the plugin itself needed additional files, wrappers, and structural changes to work properly with blocks.

The result is what you see below: a working shortcode and a working Gutenberg block, side by side in the editor. The block still behaves a little oddly — it doesn’t always show the usual outline or toolbar when selected — but you can see on the right-hand side that the block editor does recognize it and exposes all of the configuration options.

And those options are the whole reason this exists.

What I wanted was a way to visualize patterns in my Dreamy Audio podcast episodes. Specifically, I wanted to show all tags associated with posts that meet two conditions:

Shortcode and code blocks
in action
  1. They belong to the Podcasts category
  2. They include the Dreamy Audio Podcast tag

I’ve hosted more than one podcast over the years, so category filtering alone wasn’t enough. Tag filtering narrows it further — but then there’s an obvious problem: if every episode has the same identifying tag, I don’t want that tag dominating the cloud.

That’s where auto-exclude filtered tags comes in. It hides the tag used for filtering by default, while still letting me turn it back on if I want to see it. I can also explicitly exclude common tags like “Audio Diary” or “Dream Journal,” which appear on many episodes but don’t tell me much on their own.

The end result is a tag cloud that’s actually useful: it highlights recurring themes instead of restating the obvious.


Source Code

The source code is available on GitHub under an ISC License, which means you’re free to use it, modify it, and improve it with minimal restrictions.

I’ve also included a ZIP of the plugin. You can upload it directly through your WordPress dashboard and run it without any additional setup.

ISC License Details

Internet Systems Consortium (ISC) license details:

You are allowed to

  • Use the software for any purpose
  • Modify it
  • Copy it
  • Distribute it
  • Include it in proprietary or commercial software

You must

  • Keep the copyright notice
  • Keep the license text

You are NOT required to

  • Open-source your changes
  • Distribute source code
  • Use the same license in derivative works

Warranty Disclaimer: The software is provided as-is

Future Changes

There are a few improvements I’d like to tackle next:

  • Allow typing category and tag names instead of numeric IDs
  • Better styling controls (colors, spacing, min/max sizes, pill-style tags)
  • Optional display of post counts per tag

For now, my priority is continuing the slow work of properly archiving Dreamy Audio. There are still many episodes to revisit. Given the original concept of the podcast, I wouldn’t rule out reviving it someday.

I still have plenty of vivid dreams.

Update: category and tag names can now be typed. A minimum post threshold can now be set to remove all of the one-shot tags. I started noticing lots of functions named the same as React hooks, and then realized that, yes, I’m programmatically working with React using a bunch of helper functions.

Discover more from Lewis Moten

Subscribe now to keep reading and get access to the full archive.

Continue reading