Howto Manually Merge 2 categories in wordpress

So I had imported a few different blogs and other websites when i put together this one. the idea was that i could be rid of the 4 other websites or so and just have the 1. This was great in theory and i was a wordpress virgin. Everything previously used was ‘roll your own’ stuff I had written from scratch. This time I decided I would give it a go, and i stuck with it.

The importer worked brilliantly and imported blogger.com and other things all over the show. Some copy/paste was required for my own stuff, but for the most part a few well thought out SQL queries worked nicely.

My problem was that I had a couple of double up categories. Like “Facts” and “Informative”, and also “Humour” and “Funny” . I wanted to merge these together without having to manually edit every single post.

I found a few different plugins – however they were for earlier versions of wordpress. Then Apon googleing i found the following page which gave a great rundown!

http://www.franzone.com/2008/10/02/how-to-manually-merge-wordpress-tags/

Okay this is the dumbed down version for people NOT familiar with computering and SQL. Find PHPMyAdmin – its a pretty web interface thats probably installed on your server that interacts with the database.

Select your database name. Export your entire database and save it to your HDD. This is important, you might screw things up ok? No biggie if you do, you can restore it.

Now login to your WordPress backend. Click on “Categories” which shows your categories. On the right hand side of each Category it shows how many posts are in each one. If you hover your mouse over that you can see the link goes to yoururl.com/wp-admin/edit.php?cat=xxx in your status bar. If unsure then you can click the link and it will be in your URL.

The xxx is a number, That number is the category number which is the key to it all.

So find your 2 numbers of the ones you want to merge. Choose one of them as the one you want to merge into the other (ie if you have say 25 and 26 you are going to merge 25 INTO 26).

Now, heres the fun part. Updating the posts.

Open your PHPMyAdmin, click the tab at the top that says SQL. It will have a big empty box with the name at the top “Run SQL query/queries on database”

Into this box you need to type

UPDATE `wp_term_relationships`
SET `term_taxonomy_id` = xx1
WHERE `term_taxonomy_id` = xx2;

replace the xx1 and xx2 with the 2 categories you want to merge. xx1 would be the one you want to move them FROM, and xx2 is the one they are all going to move to.

If you get an error on this, by all means stop what you are doing and consult somebody else, Probably means you have that post in both categories already.

If it runs and says something along the lines of ‘complete, updated xxx posts’ then we win. Now you can remove any leftover garbage and the category. Do not run this if you have any errors.

DELETE FROM `wp_terms` WHERE `term_id` = xx1;
DELETE FROM `wp_term_taxonomy` WHERE `term_id` = xx1;

When i have xx1 here i mean use the same number you replaced earlier with xx1, the ones you moved posts out of. It should be fairly empty already.

This will not delete any posts. If all goes wrong then the most it will do is put your posts into Uncategorized.

Good luck!

Interesting ipv6 combinations

Apon talking about about IPV6 addresses on IRC with some friends, I made the comment that the addresses are hard to remember. So conversation went along the lines of using phone numbers, or making ipv4 go above 255, and pretty much every other stupid idea we could think of.
But then we realized, IPV6 is actually not to bad to remember, you just have to make sure you have some great groupings!

feed:cafe
beef:babe
dd::b00b:135

About this time i googled and found the following page

We thought it was time for some fun of the geekier kind. If you know what IPv6 is, this should be something for you.

You may have seen IPv6 addresses that contain a couple of actual words. Here is a made-up example: babe:f432:42aa:8271:eee6:1076:dead:beef

Now what if we take this one step further, and construct entire sentences inside IPv6 addresses instead of just a few words? We decided to do just that, and here is how we did it.

Constructing words inside IPv6 addresses

When showing an IPv6 address a hexadecimal notation is used. The hexadecimal digits are 0-9 and A-F (the latter corresponding to the values 10-15).

A 128-bit IPv6 address is written as 8 sets of 4 hexadecimal digits. Since initial zeroes can be skipped in each set, we can include words that are 4, 3, 2 or 1 characters long.

When constructing words, we can use the letters A-F, of course, since they are already letters. Then, to give us a few more letters to play with, we decided to include some leet-style interpretations of the numbers 0-9. (As you’re probably starting to notice, we’re a pretty geeky crowd here at Pingdom. ;) )

We went with: 0 = o or . , 1 = i or l, 2 = R, 5 = S, 6 = b, 7 = T, 9 = g.

So in the end we have the following letters to construct words with: a, b, c, d, e, f, g, i, l, o, r, s, t

Now on to constructing some actual sentences!

IPv6 addresses that make sense (sort of)

The “IPv6 sentences” below are not existing addresses we’ve found. We made them up. But although they’re just made up they are nevertheless correct and could be used in the real world.

Unfortunately we didn’t have the necessary letters to include words like “ping”, “tcp”, “http”, “down” and many others we would have liked to have in our word arsenal, but we had a lot of fun putting various sentences together over a couple of after-work beers.

Here are some of the better ones we came up with:

Happy sysadmin
2007:15:900d:0:2007:15:90d:0

(root is good. root is god.)

Fearful sysadmin
dea2:g0d:0:1a57:b007:1057:a11:da7a

(dear god. last boot lost all data)

da7a:1055:0:900d:90d::1:dead

(data loss. good god. i dead)

700:1a7e:70:face:b055::f1ee:f1ee

(too late to face boss. flee flee)

(Almost a bit of storytelling there… )

The Digg (Slashdot) effect
1f:d199:517e:02:b109:15:fa57:dead

(if digg site or blog is fast dead)

Ideal IP address for Icanhascheezburger.com
1075:0f:101:ca75:f111:a11:b109:da7a

(lots of lol cats fill all blog data)

or just:

101:ca75:101:ca75:101:ca75:101:ca75

(lol cats lol cats lol cats lol cats)

A perspective on web robots and crawlers
9e7:1057:02:d1e:b075:0:0:0

(get lost or die bots . . .)

Can’t leave them cats alone
1f:ca7:5ee5:b12d::ca7:eat5:b12d

(if cat sees bird, cat eats bird)

The truth about beer
1ce:c01d:bee2:15:a5:900d:a5:11fe

(ice cold beer is as good as life)

For ad-crazy sites
517e:ad5:f02:5a1e:0:f111:ca27:0