It’d really be more accurate to say I never stopped liking it. Sure, there was that point when it wasn’t “cool” anymore and I was too busy trying to be “cool,” but this is the kind of thing that just sticks with me. So, naturally, I’ve built up a collection of Pokémon cards. And what does someone like me do when they have a collection of something?
Build a WordPress-based database site for cataloging it, of course! This is where hashing a custom taxonomy comes into the picture.
My current plan revolves around taking the card information from the third-party Pokémon TCG Developers API and combining it with the pricing information from TCGplayer. This will allow me to store information of not just every card I have, but every version of every card I have. The most common version is the reverse holographic printing (shown below). Other versions, especially rare, powerful cards, can include full-art versions, alternate-art printings, and even rainbow-colored “secret rare” cards.
Two printings of the Komala card, one normal and the other reverse holographic.
The trick, however, is that in addition to being collectibles, Pokémon cards are also part of a game. All of these different versions of each card mean something different when it comes to collecting and pricing, but they’re the exact same card when it comes to playing the game. So while I want to be able to appreciate and track my collection in all its myriad forms, I need to be able to see what cards are the same from a game-play perspective.
In WordPress terms, we have a custom post type for cards. These cards need to be linked together if the cards are the same from a game-play perspective. This sounds like a job for a custom taxonomy!
First, here’s a peek at our custom post type (using OOPS-WP to organize things):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because some cards can have the same title but not be the same card, we need to match on something other than title. For this project, I’ve decided to use our old friend, the MD5 hash.
While it’s not useful for passwords anymore, MD5 hash is still useful for quickly determining if two things are the same. I’ll be hashing the relevant information from cards as I import them and storing that data in a non-hierarchical custom taxonomy (like a post tag). This should allow me to not only find alternate printings of cards within a set but also find cards from the past that have been reprinted in the present.
We start with our custom taxonomy:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Finally, here’s the relevant part of the import code. I’m using the PokemonTCG SDK to call the API and import the information into my WordPress install. As I do that, I’m storing the title and card text in a string that I will then hash and store in the custom taxonomy I’ve made.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because they all have the same title and text, they all have the same hash and thus are all grouped together by the custom taxonomy. Now, the next logical step is to surface this information on the frontend of the website. But that will have to in another blog post—mostly because I haven’t written the frontend yet. If you want to follow along, all my code is on GitHub. Until next time, keep having fun!
Interested in having a custom taxonomy solution built for your website? Contact WebDevStudios today.
Over the past few days, I’ve been testing the WordPress MCP server. I’ve got it running now, and honestly, it’s one of those tools that, even if not many people are using it yet, can really make life easier for developers working with WordPress...
It’s 2025, and WordPress is far from the simple blogging tool it once was. Today, it powers everything from personal portfolios to massive enterprise websites and shows no sign of slowing down. At WebDevStudios, we strive to have our finger on the pulse of...
An Overview of WordPress Playground WordPress Playground is a super cool tool that lets you run an entire WordPress site right in your browser—no need to install PHP, MySQL, or set up a server. It works by using WebAssembly (WASM) to run PHP and...
Wow, this is like you wrote it from my mind! I’ve been trying to work on my own Pokedex for years now. I’ve got the code receipts on my server too for those curious. Thanks for writing this article – now I’m one step closer to making mine a reality!
Wow, this is like you wrote it from my mind! I’ve been trying to work on my own Pokedex for years now. I’ve got the code receipts on my server too for those curious. Thanks for writing this article – now I’m one step closer to making mine a reality!