Support » Fixing WordPress » How are the posts and categories linked in SQL database?

  • Wondering how posts and categories are linked in the SQL db. I can see no field in the wp_posts table for category_id etc., nor can I see a link to posts in wp_categories.

    (I need to make batch change to a large number of imported posts, none of which were given a default category when they were imported.)

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think it’s in the post2cat table. (?)
    http://codex.wordpress.org/Database_Description/2.0#Table:_wp_post2cat

    There might be a plugin to help, too — try “Batch Categories” or browse under “Mass post management”. There’s also one called “Manage me” but it doesn’t seem to be available anymore..

    Thanks. I was able to batch change the category ID.

    The posts are still not ‘published’ however, and I’m a little concerned about messing with the SQL database.

    Anyone know if there’s a plugin which would batch-publish posts?

    Editing the DB is no biggie, as long as you make a backup first. 🙂

    Just set the post_status to ‘publish’ in the posts table. Voila, they’re published.

    Anyone know if there’s a plugin which would batch-publish posts?

    I think there’s one called “Draft Control”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How are the posts and categories linked in SQL database?’ is closed to new replies.