Where is Author Data Stored in the Database?

This guide is an introduction to how authors data is stored in the PublishPress Authors plugin.


Authors and Post Relationships #

The key thing to know is that “authors” are created using WordPress taxonomies. This means that “authors” are stored as taxonomy terms.

Here is an example of the _terms table. “Uncategorized” is not relevant for this guide because it is the default category for Posts. The other two terms are authors from the PublishPress Authors plugin.

Wp Terms 1
Wp Terms 1

The taxonomy we use to organize author profiles is “author”. This next image is from the _term_taxonomy table. Each author has one entry on this table to say the term “belongs” to the taxonomy “author”.

Wp Term Taxonomy
Wp Term Taxonomy

The _term_relationships table stores the relationships between posts and terms. This table stores the list of posts for each author, and the list of authors for each post.

Wp Term Relationships
Wp Term Relationships

_postmeta: We store one register called ppma_authors_name in this table for each post with the name of each author separated by “, “.

Wp Postmeta
Wp Postmeta

Author Profile Information #

The _termmeta table stores the metadata for each author. All the author's information is metadata. This includes the author's name, email, path to the custom avatar etc. You will find multiple rows for each author.

Wp Termmeta
Wp Termmeta

For authors mapped to a user, the user_id will also stored as metadata as well. The basic user data is copied there. Notice the user_id value in the image above: this only exists for an author who is mapped to a WordPress user. A guest author will not have this user_id value.


The Default post_author Column #

By default, WordPress records the author in the post_author column in the _posts table.

PublishPress Authors does not update that column.

Even if PublishPress Authors is enabled, WordPress will continue to record the user that created the post. So if the Authors plugin is disabled, that is the data WordPress will use to display the author.

We can't use the post_author field because it doesn't support multiple user IDs, and does not support guest authors. The PublishPress Authors plugin was created because of the limitations of this area in WordPress.