WordPress.org

Ready to get started?Download WordPress

Forums

How are the posts and categories linked in SQL database? (5 posts)

  1. swortis
    Member
    Posted 7 years ago #

    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.

  2. Sam_a
    Member
    Posted 7 years ago #

    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..

  3. swortis
    Member
    Posted 7 years ago #

    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?

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  5. Sam_a
    Member
    Posted 7 years ago #

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

    I think there's one called "Draft Control".

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags