Deleted Categories Aren't Really Deleted

I’ve run into a strange issue with categories as I’ve been building out my site and rethinking how I want to organize my posts.

For example, I had a category on my site titled “David A. Johnson” that I deleted. Shortly afterwards, I changed my mind and realized I actually needed that category, so I re-added it, albeit it with a different path. But then my “Archive” page displayed the “David A. Johnson” twice, but they each use a different path.

It’s almost like the previous version of category wasn’t truly deleted or forgotten. This has occurred several times, even after I rebuild the entire site. It seems like the only workaround is creatively renaming my categories to ensure that they don’t have the name of a previously deleted category. So, for example, if I use “David A Johnson” instead of “David A. Johnson” – note the lack of a period – then I only see the category once on the “Archive” page, as expected.

Interestingly, this does not happen in the admin area. When I’m editing posts, the list of categories is correct, i.e., there are no duplicate categories. This only seems to happen on the front-end.

You probably just need to do a full rebuild of your blog. You can find this option by going to your account page. At the bottom of that is an option to view your logs. You click that and then at the top of the next page you will see a rebuild option at the top of the page. This tells the Hugo engine to rebuild all your pages. Doing so irons out the category weirdness.

I’ve rebuilt the site several times, and no luck. The issue still happens.