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!

Tree Climbing Goats will make you snort

Dont say i didnt warn you! I got this from my sister, and snorted big and loud in the office and embarassed myself.

Before you jump to conclusions: no, these were not created by a bored geek in Photoshop. Amazingly, these uncanny animals are actually real: they climb the Argan trees of Morocco in search of food, which is otherwise sparse in the region. Over time they have become not only able to climb trees but downright adept at the art – the traipse across trees with a sure-footedness that is hard to imagine from a hoofed animal.

tree-climbing-goatsThe droppings of the goats contain the kernels of the seeds they consume which are, strangely enough, used by locals to press and grind into oil. Even more disturbingly: this oil has a number of uses including culinary (yes, people eat it) and cosmetic (yes, they also smear it on themselves). You might want to skip over the versions of these products sold by local farmers for the somewhat cleaner mass-produced varieties. For a quarter-liter bottle of this goat-digested kernel-oil you can expect to pay from 15 to 50 dollars.

amazing-goatsKnown as skilled navigators of treacherous mountain conditions, maybe it isn’t such a surprise after all to find goats making their way up the steep and narrow trunks and branches of only slightly more dangerous trees. Unfortunately, the Argan tree is slowly being over-harvested so you may have to hurry to see the real thing. Still not sure you believe the images of goats climbing trees up to heights of 30 feet? There is nothing quite like a video to convince even the most cynical skeptics:

tree-goats

And to top it off heres some video (in case you just didnt believe me!)

Originally from http://webecoist.com/2008/08/19/the-incredible-tree-climbing-goats-of-morocco/