Stable tag: 0.2.17
Requires at least: 5.4
Tested up to: 6.2
Requires PHP: 7.2
License: GPL v3 or later
Contributors: johnbillion, humanmade
A modern approach to author attribution in WordPress.
Authorship is a modern approach to author attribution in WordPress. It supports attributing posts to multiple authors and to guest authors, provides a great UI, and treats API access to author data as a first-class citizen.
Authorship is currently geared toward developers who are implementing custom solutions on WordPress. For example, it doesn't provide an option to automatically display author profiles at the bottom of a post. In the future it will include wider support for existing themes and useful features for implementors and site builders.
Alpha. Generally very functional but several features are still in development.
Features without a checkmark are still work in progress.
composer require humanmade/authorship
composer install && npm install
npm run start
Why another multi-author plugin? What about Co-Authors Plus or Bylines or PublishPress Authors?
Firstly, those plugins are great and have served us well over the years, however they all suffer from similar problems:
Let's look at these points in detail and explain how Authorship addresses them:
There's a lot more to a modern WordPress site than just its theme. Data gets written to and read from its APIs, so these need to be treated as first-class citizens when working with the attributed authors of posts.
Authorship provides:
authorship
field on the wp/v2/posts
REST API endpointsauthorship/v1/users
REST API endpointauthorship/v1/users
REST API endpoint--authorship
flagWe'd love it if you activated Authorship and then forgot that its features are provided by a plugin. The UI provides convenient functionality without looking out of place, both in the block editor and the classic editor.
Existing plugins that provide guest author functionality make a distinction between a guest author and a real WordPress user. A guest author exists only as a taxonomy term, which complicates the UX and creates inconsistencies and duplication in the data.
Authorship creates a real WordPress user account for each guest author, which provides several advantages:
WP_User
objectsThe following template functions are available for use in your theme to fetch the attributed author(s) of a post:
\Authorship\get_author_names( $post )
\Authorship\get_author_names_sentence( $post )
\Authorship\get_author_names_list( $post )
\Authorship\get_authors( $post )
\Authorship\get_author_ids( $post )
The following REST API endpoints and fields are available:
authorship/v1/users
endpointThis endpoint allows:
authorship
fieldThis field is added to the endpoint for all supported post types (by default, ones which that have post type support for author
), for example wp/v2/posts
. This field is readable and writable and accepts and provides an array of IDs of users attributed to the post.
In addition, user objects are embedded in the _embedded['wp:authorship']
field in the response if _embed
is set and the authenticated user can list users.
Authorship implements a custom flag for use with posts, and migration commands. The following WP-CLI flags are available:
--authorship
--authorship
flagWhen creating or updating posts the --authorship
flag can be used to specify the IDs of users attributed to the post. The flag accepts a comma-separated list of user IDs. Examples:
wp post create --post_title="My New Post" --authorship=4,11
wp post update 220 --authorship=13
If this flag is not set:
--post_author
flag is set then it will be used for attributed authorsIf you activate Authorship on an existing site, all content already created will not have authorship data set for old content. This breaks things such as author archive pages.
This command will set the WordPress author as the authorship user for any posts with no authorship user. (Optionally you can override any existing authorship data, updating it with the WordPress post author).
wp authorship migrate wp-authors --dry-run=true
The command will perform a dry run by default, setting --dry-run=false
will make changes to the database.
This command will not overwrite or update Authorship data unless the --overwrite-authors=true
flag is set.
Authorship provides a command for creating Authorship data using data from PublishPress Authors. This allows a non-destructive migration path from PublishPress Authors.
With both plugins active, this command will copy PPA data into Authorship:
wp authorship migrate ppa --dry-run=true
The command will perform a dry run by default, setting --dry-run=false
will make changes to the database. Guest authors that do not exist as users will be created with blank emails and random passwords.
This command will not overwrite or update Authorship data unless the --overwrite-authors=true
flag is set.
Authorship does not send any email notifications itself, but it does instruct WordPress core to additionally send its emails to attributed authors when appropriate.
This plugin only adjusts the list of email addresses to which these emails get sent. If you want to disable these emails entirely, see the "Email me whenever" section of the Settings -> Discussion screen in WordPress.
Authorship aims to conform to Web Content Accessibility Guidelines (WCAG) 2.1 at level AA but it does not yet fully achieve this. If full support for assistive technology is a requirement of your organisation then Authorship may not be a good fit in its current state.
With regard to the author selection control on the post editing screen:
The team are actively investigating either replacing the component used to render the control with a fully accessible one, or fixing the accessibility issues of the current one.
Great care has been taken to ensure Authorship makes no changes to the user capabilities required to edit content or view sensitive user data on your site. What it does do is:
The capability required to change the attribution of a post matches that which is required by WordPress core to change the post author. This means a user needs the edit_others_post
capability for the post type. The result is no change in behaviour from WordPress core with regard to being able to attribute a post to another user.
Authorship allows the attribution to be changed for any post type that has post type support for author
, which by default is Posts and Pages.
When a user is attributed to a post, that user becomes able to manage that post according to their capabilities as if they were the post author. This means:
From a practical point of view this feature only affects users with a role of Author or Contributor. Administrators and Editors can edit other users' posts by default and therefore edit, publish, and delete posts regardless of whether they are attributed to it.
The authorship/v1/users
REST API endpoint provides a means of searching users on the site in order to attribute them to a post. Access to this endpoint is granted to all users who have the capability to change the attributed authors of the given post type, which means Editors and Administrators by default. The result is no change in behaviour from WordPress core with regard to being able to search users.
In addition, this endpoint has been designed to expose minimal information about users, for example it does not expose email addresses or capabilities. This allows lower level users such as users with a role of Author to be granted the ability to attribute users to a post without unnecessarily exposing sensitive information about other users.
The authorship/v1/users
REST API endpoint provides a means of creating guest authors that can subsequently be attributed to a post. Access to this endpoint is granted to all users who have the ability to edit others' posts, which means Editors and Administrators by default.
More work is still to be done around the ability to subsequently edit guest authors, but it's worth noting that this is the one area where Authorship diverges from the default capabilities of WordPress core. It allows an Editor role user to create a new user account, which they usually cannot do. However it is tightly controlled:
create_users
capability, which only Administrators doThe following custom user capabilities are used by Authorship. These can be granted to or denied from users or roles in order to adjust user access:
attribute_post_type
edit_others_posts
capability of the post type by defaultcreate_guest_authors
edit_others_posts
by defaultCode contributions, feedback, and feature suggestions are very welcome. See CONTRIBUTING.md for more details.
Authorship is developed and maintained by Human Made and Altis. Its initial development was funded by Siemens.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
If the Authorship plugin doesn't suit your needs, try these alternatives: