Support » Fixing WordPress » Solution for 2.3 database errors / wp_post2cat does not exist

  • If you are getting a database error like this:

    WordPress database error: [Table ‘wp_post2cat’ doesn’t exist]
    SELECT p2c.category_id AS cat_id, COUNT(p2c.rel_id) AS numposts, UNIX_TIMESTAMP(max(posts.post_date_gmt)) + ‘8’ AS last_post_date, UNIX_TIMESTAMP(max(posts.post_date_gmt)) AS last_post_date_gmt FROM wp_post2cat p2c INNER JOIN wp_posts posts ON p2c.post_id=posts.id WHERE 1 = 1 AND posts.post_type = ‘post’ AND posts.post_status = ‘publish’ AND posts.post_date_gmt <= ‘2007-09-19 12:08:25’ GROUP BY p2c.category_id ORDER BY numposts DESC

    or like this:

    WordPress database error: [Table ‘wordpress.wp_post2cat’ doesn’t exist]
    SELECT c.cat_name FROM wp_post2cat p2c INNER JOIN wp_categories c ON p2c.category_id = c.cat_id WHERE p2c.post_id = 218

    or like this:

    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

    or any other database error which contains wp_post2cat or wp_categories, you are using a plugin or theme which is not compatible with WordPress 2.3.

    Example plugins which don’t work:

    It could also be that your theme is causing this error:

    Please double check before posting that you don’t use any incompatible plugins. A list of plugins that work and which won’t work can be found at the WordPress Codex.

Viewing 15 replies - 61 through 75 (of 100 total)
  • Thnx for the tips!! 😀
    I had the same error:

    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

    but then I updated Google Sitemaps Generator plugin and Search everything plugin and then the error was gone!! Thnx for the help!!

    Hmm… If I fixed a once bugged plugin, is it against the rules to post it? Or do I need something like permission?

    I am using the Custom Write Panel plugin from Rhymed Code – it is VERY good allowing the creation of new write panels with a whole bunch of custom fields. It also allows these custom write panels to publish content in a fixed category.

    This plugin makes WordPress so easy to use for many, many people, and helps turn it into much more of a CMS system. I consider this to be one of the most important plugins available for WordPress.

    However, it suffers from the dreaded errors as it can’t show the categories now (amongst other things). It worked perfectly on the 2.2 branch.

    PLEASE – has anyone worked out how to fix this yet? The author seems to not be around at the moment, I have left comments.

    I don’t have much cash, but I’d be willing to throw someone a small PayPal donation as an incentive!

    ‘Custom write panel’ also comes with a stern warning about its state of development:

    Custom Write Panel version alpha is available below. Though unstable (I suppose, since it hasn’t undergone many test cases), it should be safe to install it.

    We seasoned users and developers do understand how frustrating new versions and changing interface can be, but it’s really not possible even to just notify all the makers of all the different themes and plugins about changes in interfaces they are or have been using.

    Leave comments on the blog-posting announcing the version that is giving you trouble. Others who can fix problems will actually check for new versions before fixing it on their own, read your comment and might share fixes with you.

    Yup – you are right about the warning regarding Custom Write Panel, but it works perfectly… I think it was because it is still officially in an alpha stage.

    I have left 2 comments (along with someone else that mentions WP2.3 compatibility) and hope that the developer is able to fit this in.

    I can only imagine how infuriating it must be to have to go back and re-engineer the PHP of your plugins when the structure of WP changes like this.

    Here’s fingers crossed that someone picks up on this – I know Custom Write Panel is not that popular, but it really is a VERY powerful plugin and can be used to great effect to make WordPress act like a custom CMS – hats off to the dude who wrote the plugin!

    I just installed and am getting this error with ALL my themes (even the default ones) even after I turned off all my plug-ins. I can login to my admin page. 🙁

    I’m not a big coder but I go this far so I’m finally asking or help.
    Any suggestions?

    BEGIN QUOTE:

    WordPress database error: [Table ‘username_wp.wp_terms’ doesn’t exist]
    SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (‘category’, ‘post_tag’) AND tr.object_id IN (11, 10, 9, 8, 5) ORDER BY t.name ASC

    For adding tags to your themes, view this guide.
    http://richgilchrest.com/how-to-add-wordpress-23-tags-to-your-current-theme/

    why does this link keep crashing Safari browser ? Everytime i click on it it kills Safari, anyone have that trouble ?

    click on the link at the top of the post and you see what i mean

    I’m having the same issue and it keeps pointing to a pluggable.php file. I keep turning each plugin off one at a time and cannot locate which one seems to be causing the issue since I upgraded.

    Hi,

    I am blogging with WordPress 2.3. I started the blog off with this version, it was not an upgrade. I am getting the proverbial [Table “wordpress wp_categories does not exist’] error.

    I have checked my plugins and theme agaist the lists of acceptable themes and plugins. I am using the theme Silver Light 0.1 with Akismet 2.0.2 (the only plugin).

    Please help…

    I installed 2.3 from scratch, as well. No upgrade.
    I use theme Tiga, which is not in the compatibility list (I noticed later), but I installed the patch. This patch apperantly doesn’t solve the problem, as I still have the error message:

    WordPress database error: [Table ‘****.wp_categories’ doesn’t exist]
    SELECT cat_id, cat_name FROM wp_categories WHERE link_count > 0

    in stead of my links/blogroll.

    Furthermore, the presentation/widgets/Sidebar Arrangement doesn’t work. It stick to the default Tiga widgets.

    Any idea’s/suggestions?

    Perjan

    What the heck! I installed the patch again, and the problem is gone.

    So for Tiga, the problem is solved with the patch.

    Perjan

    All plugins deactivated and still have same error as everyone else. Assuming it’s the theme. What are the main areas to look for when trying to upgrade the theme?

    Everything works except <?php
    wp_list_categories(‘orderby=name’); ?>

    I did notice that my permalinks all broke on my pages. Is there a need to re-create the categories?

    I just want to add my experience to this upgrade mess.

    I originally loaded up WP v2.0.2 which was available from my hosting company, but prior to beginning any theme development, I loaded up v2.3 and ran upgrade.php. Everything was great.

    I took a theme (green field or something like that) and modified it to fit my needs.

    I launched my site last Thursday night. Of course, I then see the notification for a new release candidate that supposedly fixes some bugs and introduces taxonomy changes.

    I loaded it up and transferred the code to my web server. Crash.

    I had an events calendar plugin that was failing. I went into the plug in code and commented out the failing function and I was then able to access my admin panel. Ok, deactivate the plugin and try again.

    At that point I ran the upgrade.php script and it ran quickly. I could now access my site, but there were errors in my category and page listing splashes.

    I dug into the code and found that the categories were transformed into taxonomies and the underlying schema had been modified as well. For whatever reason, I also found that my pages had been converted to posts!

    Ok, this update sucked.

    I found my old 2.3 zip file and unpacked the code. Next, overwrite the code on my web server with 2.3.0 code. Last, go into phpmyadmin and:

    1) retrieve the IDs of the posts that were actually pages and update the column (post_status, I think) to be ‘static’. Now my pages were back.

    2) rather than reverse the DB conversion to rebuild my categories table, I simply went back into the admin panel, created new categories, and then updated my posts (I only had 3, but if I had a year’s worth, I would’ve been pissed).

    I’ve put a decent amount of work into modifying the theme I’m using, so I’m not about to dump it. My next plan of action is to copy my site’s directory into a test bed directory, load up the 2.3.1 code, and then spend some time fixing all the bugs. At first glance, it appears that I’ll need to modify my theme’s code to work with taxonomies instead of categories, so it might not be so bad.

    It’s a good lesson I’ve learned, though… never trust an update.

    I got it resolved by deactivating the two plugins:

    1 Google Sitemaps
    2 SimpleTags

    Thanks

    I wish I could make these changes and could disable my plugins. However, when I try to login I get a Internal Service Error 500.

    I cannot access my control panel. Any suggestions? Thanks.

    http://blog.seattle-duiattorney.com/

Viewing 15 replies - 61 through 75 (of 100 total)
  • The topic ‘Solution for 2.3 database errors / wp_post2cat does not exist’ is closed to new replies.