WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
how to add/replace/delete authors in bulk via SQL (1 post)

  1. kcorcoran
    Member
    Posted 1 year ago #

    I am using this plugin and I need to add authors to multiple posts based on post category.

    Normally without the plugin I would view all posts of a category in the WP Admin, select bulk edit, then change author. But that function is irrelevant here given multiple authors.

    I assume I need to run a SQL statement to do this.

    I am using the following statement to return all posts of a certain category.

    SELECT * FROM wp_posts
    INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
    INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    WHERE (wp_term_taxonomy.term_id = 23
       AND wp_term_taxonomy.taxonomy = 'category'
       AND wp_posts.post_type = 'post'
       AND wp_posts.post_status = 'publish');

    How can I add author IDs to the co-authors to the results of this query using SQL directly?

    Thanks.

    http://wordpress.org/extend/plugins/co-authors-plus/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic