Documentation Co-Authors Plus: Add guest bylines to your content

Co-Authors Plus: Add guest bylines to your content

Overview #

Co-Authors Plus is a plugin maintained by WordPress.com VIP which makes it easy to assign one or more bylines to a post. With the guest authors feature, you can assign a byline to content without having to create a corresponding WordPress account. And, if your theme is using the appropriate template tags, you can create guest bylines without any additional configuration.

↑ Top ↑

Creating or Editing Guest Authors #

On WordPress.com VIP, guest authors can be created and managed under “Tools” -> “Guest Authors”.

Each guest author can have many of same fields a normal WordPress user would typically have, including display name, email address, and website. You can assign a featured image in order to override the avatar typically associated with the email address.

Once you’ve created your guest author, his or her byline can be assigned to a post using the normal Co-Authors Plus interface.

Details for Developers

↑ Top ↑

Incorporating new profile fields #

The guest authors feature of Co-Authors Plus was written with extensibility in mind. The default set of profile fields can easily be manipulated using accessible filters. If you want to place your field in one of the existing post meta boxes, it can be as simple as the following example:

Then, for use on the frontend, the new field is automatically loaded onto the $coauthor object.

↑ Top ↑

Migrating users to guest authors with wp-cli #

If you’re performing a migration of users to co-author guest authors, there are a couple of helpful wp-cli commands packaged with the plugin:

  • wp co-authors-plus create-guest-authors will create guest authors for all of your existing users
  • wp co-authors-plus assign-user-to-coauthor will then assign all of the posts associated with old user to your new guest author

So, the steps to migrate all of your users/authors to your WordPress.com VIP site would include:

  1. Install the Co-Authors Plus plugin on your staging site
  2. Run the create-guest-authors CLI command to create the Guest Authors automatically
  3. Perform an export from your staging site and save the resulting WXR file. The WP-CLI guest authors will be included in this export.
  4. Invite all of your normal authors to your WordPress.com VIP site and have them create their own WordPress.com user accounts.
  5. Create a mapping CSV file for editorial users who require real logins from their login on the staging site to their login on WP.com.
    The CSV file format is as simple as:

    johnsmith, johnsmithwp
    janesmith, janesmithwp
    johndoe, johndoewp
    
  6. Send us the WXR and mapping CSV, and we’ll run the import for you. While Co-Authors Plus will bring over all the bylines, we’ll use the mapping CSV to preserve the bylines for users with real logins.
  7. Have your team QA the imported authors.