Renumber categories?
-
After running my blog a while, adding and removing categories, the category numbers are all over the place. I like to renumber/reset them.
I the old days you could do as described here:
Renumbering Categories in WordPress Blogs
but since v2.3 this is no longer valid information, i.e:
UPDATE wp_categories SET cat_ID=2 WHERE cat_ID=3 LIMIT 1; UPDATE wp_post2cat SET category_id=2 WHERE category_id=3;
doesn’t work since the wp_categories and wp_post2cat tables are no longer used.
After studying the new database structure in phpMyAdmin, I came up with this:
UPDATE wp_terms SET term_ID=2 WHERE term_ID=3 LIMIT 1; UPDATE wp_posts SET post_category=2 WHERE post_category=3;
No luck. The first SQL command seems to work, but not the second.
A closer look at the wp_posts table reveals that the post_catagory field doesn’t in fact seem to be used for the obvious, i.e. storing information about which category a post belongs to. This seems a bit strange, but even stranger is that I can’t seem to find this information in any field anywhere.
I don’t know anything about sql really, so I’m just trying to apply general logic here. I bet there is someone in the WordPress community that can sort this out for me.
Thanks in advance,
/Mats
- The topic ‘Renumber categories?’ is closed to new replies.