WordPress Database Error – Table ‘wp_post2cat’ doesn’t exist

I recently upgraded my hosted WordPress from version 2.2 to 2.3.1. The upgradation process went smoothly but something strange happened when I tried to log into the administration dashboard. When I logged in, the page showed me a message stating that my database was old and I needed to upgrade it. I did as it suggested and the dashboard came into picture as usual. All till this point seemed fine, until I did the following things:

  • Tried to add a new category
  • Tried to edit a post
  • Tried to comment from the blog post page

When I tried to do the above things I was shown a big fat error message which cried out,

WordPress database error: [Table ‘wordpress.wp_post2cat’ doesn’t exist]
SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM wp_posts p LEFT JOIN wp_post2cat pc ON p.ID = pc.post_id LEFT JOIN wp_categories c ON pc.category_id = c.cat_ID WHERE post_status = ‘publish’ GROUP BY cat_ID

I managed to resolve this error in some time but those few moments were somewhat shocking. If you are getting the same error, the solution is quite easy. At first the error looks as something has gone wrong with your database but believe me, your database is fine. The problem maker are the plugins. The main cause of the above error are the following plugins:

  • Google Sitemaps Generator
  • Posts by Author plugin
  • Ultimate Tag Warrior
  • Similar Posts

Just disable these plugins and you should see your error disappear. You can later put in the latest versions of the above plugins and activate them. The Ultimate Tag Warrior plugin should not be required in my opinion since WordPress 2.3 + has the feature of tagging a particular post.

Always remember, before upgrading a WordPress to a newer version make a double check on the compatibility of the plugins you have already installed. The guys at WordPress have made out jobs much more easier by putting an alphabetically sorted list of compatible plugins with WordPress 2.3.

So when you install a plugin for WordPress in future do the following:

  • Download it from the official WordPress plugin repository
  • Check the version of WordPress till which the plugin is compatible with
  • Backup your blog through WordPress Export feature before trying out a plugin.

Sometimes if you have self coded the theme, the error might not disappear because you might have used some tables like “wp_post2cat” which has been discarded in the newer version. So if your error is still not resolved try using the default theme (Kubrick) and then work your way out.

27 thoughts on “WordPress Database Error – Table ‘wp_post2cat’ doesn’t exist

  1. This article needs to be promoted more. I see this a lot with people who finally upgrade their old blogs and then see this error, who are using a theme which was modified from the default (kubrick) theme or one of its derivatives. So if it isn’t a plugin, it might be the theme.

  2. hai

    i am using wordpress2.1
    i installed survey wp-surveys
    when i click surveys
    below error occured pls help me i trying long days
    WordPress database error: [Table ‘indiatimeswinhost_wp127.wp_surveys’ doesn’t exist]
    SELECT * FROM wp_surveys WHERE survey_open=’1′ LIMIT 1;
    Survey Management
    Active Survey:
    There are no open surveys.

    WordPress database error: [Table ‘indiatimeswinhost_wp127.wp_surveys’ doesn’t exist]
    SELECT survey_id FROM wp_surveys ORDER BY survey_id DESC LIMIT 1;

    WordPress database error: [Table ‘indiatimeswinhost_wp127.wp_surveys’ doesn’t exist]
    SELECT * FROM wp_surveys WHERE survey_open=’0′;
    Retired Surveys:
    There are no retired surveys.

    thanking you
    namisen

  3. Ahhh.. you saved me tons of time, hair pulling and probably a bottle of aspirin or two. I had a long time blog that has been sorely in need of an upgrade, and I *finally* got around to doing it, only to realize that i kept getting database errors when trying to edit or delete posts etc…

    And of course, this was one of those times where i didn’t make a backup so needless to say i was slightly freaked out. I hadn’t considered that a plugin could have been the culprit in a database related error like that, so you really came to the rescue with your post!

    As soon as I disabled a couple of plugins, i found myself back in business.

    Thanks very much indeed!

  4. I had issues with this wp_post2cat, I suspected a statistics plugin, but becasue the issue only appears on a single blog, I will try to search the template files for the problem. Thanks for this post, I wasn’t even sure if I supposed to search in the template but now makes a lot of sense.

  5. Priligy Price
    Buy dapoxetine online, for the fabulously LOW PRICE!
    CONTENT: Purchase Dapoxetine. Name: Purchase Dapoxetine. Title: Dapoxetine. ORDER Dapoxetine NOW! Location: san antonio, Texas. Offline. United States …
    Priligy Dapoxetine Hydrochloride
    Dapoxetine Priligy
    Priligy Janssen Cilag
    Does Priligy Work
    priligy lasting longer in bed sexual treatment information related to premature ejaculation and dapoxetine -priligy, the drug targeted to cure this disease …
    Priligy Buy Online
    Priligy In Canada
    Dapoxetine (Priligy) for sale, Find complete details about Priligy from Danske Plant Foods & Research chemicals. You may also find other Priligy products or …
    Buy Cheap Super P Force online. Online Pharmacy with 100% satisfaction guarantee. Stay longer in bad.
    Premature Ejaculation Priligy
    The weekend of 16-17th February marked the buy dapoxetine 50th anniversary of the founding of CND. To celebrate this CND hosted a Global Summit for a …

Leave a Reply

Your email address will not be published. Required fields are marked *