Warning: include_once(/home/yotangy/puppetkaos.com/wp-content/plugins/wordpress-support/wordpress-support.php): failed to open stream: Permission denied in /home/yotangy/puppetkaos.com/wp-settings.php on line 268

Warning: include_once(): Failed opening '/home/yotangy/puppetkaos.com/wp-content/plugins/wordpress-support/wordpress-support.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/yotangy/puppetkaos.com/wp-settings.php on line 268
How I Battled the WordPress Category Missing Problem « Puppet Kaos - where Kelvin Kao plays with puppets and tell random stories
subscribe to rss feed
subscribe by email

Puppet Kaos - where Kelvin Kao plays with puppets and tell random stories

How I Battled the WordPress Category Missing Problem

This is going to be THE most technical post that’s ever appeared on this blog, so if you can’t stand it, just skip over this post. I am pretty sure that we’ll be back to more fun stuff soon. 😀

As I’ve mentioned in the previous post, I upgraded my WordPress from version 2.1 to 2.6. Unfortunately, after the upgrade, all my post categories were missing. It took me a while to get them back again, and I’m writing to document what I went through and to share a solution if you ever run into this problem as well.

First let’s talk about the upgrade. I did this by downloading the new version from WordPress.org, and then uploading them onto my server, overwriting the previous files. Before I did the upload, I backed up my old files in case the upgrade failed and I would have to restore to the old files. After I uploaded the new files, I logged into my WordPress dashboard, and I was greeted with a question asking whether I wanted to also upgrade the database. I clicked on yes without thinking too much. This was sort of a mistake. I didn’t back up my database because I wasn’t planning to change it, but clicking yes meant that I’m allowing WordPress to make changes to my database. It’s a good thing that I only lost my categories and nothing more.

Anyway, after the database upgrade was also done, this was what my website looked like. All the category labels are missing:

After Googling around for a fix, I found this webpage. I didn’t follow it exactly but I was doing stuff along the line of what he did. First you want to view your database. My site and the tutorial author’s site both use phpMyAdmin. Depending on what you have installed on your server, this step might be somewhat different. But you want to go view your wp_categories table. You will see that all the category descriptions are gone. I then used the pencil icon to edit all the category descriptions. I changed them to something like aaaaa, bbbbb, ccccc, etc. This is so I will know which categories are actually used. This actually turned out to be an optional step, but it can save you some confusion down the line. Here are the before and after pictures:

Now go to http://(your site url)/wp-admin/categories.php?action=edit&cat_ID=(category number) where (your site url) is your url, and (category number) is the category ID. From my example, you can see that I have 18 categories. But they are not all consecutive numbers. You will have to put that address into your browser for as many categories as you have. I had 18 categories so I had to do that 18 times with a different cat_id each time. Once the address is put in, this is what it would show:

The Description is something that you already entered in the previous step. Now you want to fill in Category Name and Category Slug. I will explain what they are later. For now just put in the same thing and save the category. Note that although the description entry was optional in the last step, it was good to have so you can double check which categories are valid since sometimes they do skip numbers in category IDs. If there was a description, you knew you are editing a valid category.

And now go to your WordPress dashboard again. Go to Manage tag, and then select Categories. You will see your category manager. In the following picture on the left, I’ve already done aaaaa through nnnnn. Notice the stuff after ooooo still has no Name (label) yet. Eventually these would all be filled out. And in the picture on the right, you see on the blog that categories are no longer missing… they are just called really weird names consisting of repeating letters. On the site it would’ve showed up as something like the picture on the right:

And finally, it’s time to correct all the category names in the category manager again. When I looked at Category ddddd, for example, I can click on the number 23. It would show a bunch of posts that was filed under this category. In this case, they were Episode 15 – Godfather Nightmares, Episode 14 – Tofu, Episode 13 – Tis the Season to be Charlie, etc. So I knew that the category name it should have is “My videos”. So I clicked on “ddddd” and an editor would pop up, now that we actually some kind of label to click on. Go ahead and change the name and slug. The Category Name is the name that would show up on the sidebar as a category or under a post. In this case it’s “My videos”. The Category slug is what would appear in the web address for this category. In this case I chose “my-videos” because I didn’t want spaces in my url. So go through and modify all categories to have the appropriate names and slugs, and you’ll have all categories back. So this is what it looks like when it’s all done:

Wow, that’s a lot of info. There might be smarter ways of doing it, but that is what I’ve tried and it worked. This is fun. Lots of fun. Way too much fun.

Comments

  1. August 3rd, 2008 | 7:08 am

    Kelvin,
    To mis-quote “Jerry McGuire,” – you LOST me at “hello.” As someone who is TOTALLY new to WordPress (maybe 4 days?) – I am still trying to figure out things like why my web site is now connected to “selling drugs” on Google! (And boy, do I apparently sell some GREAT drugs!)

    Nonetheless, I’m so glad that you’re having so much fun! If you get too excited, however, and need some tranquilizers, I guess I can get them for you without even visiting a doctor’s office!

    Rita

    Rita’s last blog post..Second “Reader’s Choice” Blog – My 10 Favorite Books

  2. August 4th, 2008 | 3:14 am

    When I said fun, it was half sarcastic. But only half. I admit that as a programmer, I get a rush solving problems. It was time-consuming though, so that part wasn’t particularly fun.

Leave a reply

CommentLuv badge

Based on FluidityTheme Redesigned by Kaushal Sheth Sponsored by Web Hosting Bluebook