Support » Fixing WordPress » Problems with categories, wp_term_taxonomy and wp_terms – new upgrade

  • Recently I upgraded from 2.0.2 to 2.6. The problem is that the categories were missing from the posts. I checked phpMyAdmin/the database and found that -2-2-2-2-2-2-2-2-2 appeared throughout wp_terms table.

    I’ve gone in and tried cowboyuk80’s advice by emptying wp_terms and pasting sql script (which you can find here:, but it didn’t seem to work (only Blogroll, Uncategorized showed up in wp_terms) …so I emptied the table and proceeded to match the old Category information, and added to wp_term_taxonomy – (following the advice found here: – I manually edited a few records and filled in all of the descriptions, then went into wp_terms, inserted new rows and matched up the information now in wp_term_taxonomy. This worked and the categories started to show up again on the blog posts.

    I have hundreds of categories, adding them manually will take hours. Also, in the meantime, I foolishly started adding posts in WordPress, with new tags and categories, and found that the tags were showing up in wp-admin/Categories and in wp_term_taxonomy. That was a mistake – when I checked I saw that the tags were overriding the old category id numbers in wp_term_taxonomy, so I’ve now stopped adding them — and they were added in wp_terms, showing up in random/high numbered ids. (I really hope I’m being clear with my description). I’ve also noticed that the wp_term_taxonomy and wp_terms term_ids are now out of sequence starting at 59 and I’m not sure what to do at this point. I think this will lead to problems if the term ids between the two tables don’t match.

    I’m aware that the two tables are working with wp_term_relationships, so am concerned what will happen if I empty the two tables (terms and taxonomy) and start again.

    If I pick 20 categories in wp_term_taxonomy and the 20 matched ids in wp_terms, to keep, and then delete all the other categories/terms in both tables, what will happen in wp_term_relationships? Can I do that? (I don’t mind deleting the bulk of categories if I can keep a few.)

    Or are there other alternatives?

    I’ve made a mess here, I regret it, and would really appreciate all the help I can get.


Viewing 15 replies - 1 through 15 (of 20 total)
  • Can anyone help with this? Or maybe someone knows somebody who can help? I’m at a stand still with this issue…

    I hope you kept backup of your SQL. Someone else had same problem.
    Here’s a solution which worked. Good luck.

    Thanks for the link. I will look into this. I did backup. This will be the first time that I’ve had to do any kind of manual install…do I follow the install instructions in the codex for each upgrade?

    Hoping that I can do this successfully – once done, how do I add the new entries (backup SQL) that I’ve been posting since the upgrade to 2.6, that wouldn’t be on the original backup?




    I just upgraded a 2.1 install to 2.6.1 last night — and in my infinite wisdom tried to do it in one leap. It didnt work out so well, and the 2-2-2-2-2-2-2 problem happened to me. I had to import in the old SQL dump I took right before starting. Then I did it incrementally

    2.1 -> latest in 2.2-> 2.3.3 -> latest in 2.5 -> 2.6.1

    That worked flawlessly.

    jam22, for curiousity’s sake, how many new posts did you make after upgrading to 2.6 from 2.0.2 inspite of the 2-2-2-2? If only a few, just copy and save those posts’ html in text and repost after you get the latest version working.

    Oh, shucks. @ what whooami wrote.

    I thought 2.6.1 was going to fix this. Not fix it on already-upgraded installs, but fix it in the Upgrade routine so that older blogs could be updated to 2.6.1 without getting the 2-2-2-2-2.

    I’ve already upgraded 2 blogs, and manually fixed the Categories in phpMyAdmin. It was not fun.

    I guess I see now that I’ll have to upgrade thru each version of WP that I skipped consecutively. Grrrreaaat. How do you recommend doing that quickly? For me that would take hours / days, because it takes so long for TinyMCE to FTP 100’s of files. Is there some good way of just FTP’ing the ZIP file of WP? I don’t know how to extract it on the server if I did that.

    Depends on what version you’d be upgrading from. I exported the XML from version 2.2 install and imported to 2.6. Just made sure that you could configure or ask techs at webhost to increase max file upload size to XML file size to be imported.

    whooami installed by these increments: 2.1 -> latest in 2.2-> 2.3.3 -> latest in 2.5 -> 2.6.1 ;

    and then the link that mercime provided suggests this:

    1) upgrade from 2.1 to 2.2 then check the posts and files – backup sql and files
    2) upgrade from 2.2. to 2.3 then check the posts and files – backup sql and files
    3) upgrade from 2.3 to 2.5.1 then check posts and files – backup sql and files
    4) upgrade from 2.5.1 to 2.6 then check posts and files – backup sql and files.

    Which should I do? They’re a bit different. I am going from 2.0.2 so I would think that I would upgrade to 2.1 and then…

    mercime – Yes, I will copy and paste the posts and change the slugs to the original dates.

    Silly question, but when I do the first install back to 2.0.2, do I first drop the current tables and then import the old SQL, and then add the 2.0.2 install? I think I need more explicit directions to get me started. Really appreciate the help!

    I just posted what worked for me and whooami posted what worked on that end. If you read that topic till the end, atuttle upgraded via 2.1 – 2.2 – 2.3 – 2.5 – 2.6, major releases.

    Yes, that’s right. Drop tables, import SQL, upload WordPress 2.0.2 wp-admin and wp-includes then upload the default theme to wp-contents/themes/ then run install.php. Check and note numbers of posts and pages. I forgot to mention in other post, that after all’s okay with install, run and click to continue. Backup SQL (noting the version).

    Then you go through the process of upgrading 2.0.2 to 2.1 by uploading wp-admin, wp-includes and then uploading the default theme per info above. No need to run install.php, in fact you can delete install.php. just check whether you still have same number of posts and pages. If ok, run upgrade.php … then upgrade to 2.2 step by step until you upgraded to latest, always backing SQL and XML of each upgrade that’s successful.

    From version 2.2 aside from SQL backup, consider Exporting XML file for backup as well. It’s good to have many and different backups.

    Adding new themes and plugins should be done after all’s well on your latest version upgrade. Good luck.




    yes, I just chose the last small revision of the larger, so instead of 2.3.2 i chose 2.3.3 .. this was a site Im moving and upgrading as part of my actual real life job, mind you. 🙂




    because it takes so long for TinyMCE to FTP 100’s of files

    You dont need those, not just to upgrade from 2.1. to 2.2 on your way to 2.6… dont upload them.

    you dont need any images either. 🙂

    mercime + whooami – you have been a great help – and I plan on attempting the install tomorrow. I think this is all the information I need to move forward! Fingers crossed. I’ll let you know how it goes. Thank you!

    I did the installs and upgrades of the major releases – stressful at first, but went without a hitch! Thanks again for your help.

    Well, everything went well until I tried posting, and then received this message:

    “Warning: Unresponsive script

    A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.”

    Write Post is very, very slow loading now in 2.6, where as before I did the upgrades/installs and added all the categories back in, there was no problem at all in version 2.6.

    I’ve been combing the message boards and have been trying to fix this, but haven’t had any luck.

    Even looking into all the advice here – – but nothing is working.

    I’ve also looked at wp_postmeta, but there were no post_ids with 0

    Could it be that I have too many categories? I have hundreds, but can try deleting them to see if it works…

    Once again, would really appreciate any help.

    The 2nd solution worked with one install for me. Did you try to run the SQL query at least?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Problems with categories, wp_term_taxonomy and wp_terms – new upgrade’ is closed to new replies.