WordPress: All Tags and Categories Suddenly Disappeared!

[3 minute read]

Late last night, as I was writing up a new blog post, I glanced down at my category list and realized I needed to change what was selected. Right away, I noticed that the “Most Used” tab was selected instead of “All Categories”. I must have clicked it by accident, I thought. But when I clicked the “All” tab, it was empty. The list was completely blank. I went back to the “Most Used” list and they all seemed intact. But the All tab remained empty. I then noticed the tags I had selected for my post were no longer there. I checked the “Categories” admin page. Sure enough, no categories were listed. I went to the “Tags” page, and all those appeared to still exist, but when I looked at my list of posts they all were marked as “Uncategorized” and “No Tags”. I went to my blog. No categories were listed there either. I clicked on a blog post to see if it still loaded. Nope. Instead, I got this error:

Catchable fatal error: Object of class WP_Error could not be converted to string in /[some-secret-path]/wp-content/themes/DualFlow/functions.php on line 604

Interestingly enough, when flipping back and forth between different areas of my admin area and the Categories page, sometimes all my categories would reappear for a short while. Reload the page and poof! they were gone again. My next stop was my database. I could immediately see that all my categories were still there, which was a relief. A bit of googling also revealed that other people had experienced exactly the same issues. Some reported that the problem resolved itself within a few hours, others indicated that their MySQL tmp directory had reached 100% capacity and needed to be cleared. And in several places, the person making the complaint never returned to tell the rest of us what happened. This latter situation resulted in a predictable trail of follow-up posts along the lines of “I’m having the same problem! How did you fix it?!” Which is exactly why I decided to write up a post about my experience.

The end of my story is simply that I searched for a solution until 2:00am, determined it was either a temporary issue or one that would have to be addressed by my web host, and went to bed. As soon as I woke up, the problem had indeed resolved itself. All my categories and tags were restored and all my posts appeared to be correctly organized. So if you have this problem, the best advice I can give you is to hang tight for a few hours and see if it fixes itself. If not, try clearing out your MySQL tmp directory or get on the horn with your web host and ask them to investigate the issue. For reference, here’s a list of the related posts I found when researching the problem:

You might also poke around in your database to make sure all your categories are still intact. Here’s an ERD for WordPress databases, if it helps you figure out what is where.