Where is Author Data Stored? And How to Backup
The PublishPress Authors plugin don't provide an option to export or import the author's data or settings yet.
However, we use WordPress API which means that any plugin that is able to export taxonomies, options and post metadata can also be used to backup or restore the PublishPress Authors data. This is the most flexible way to add and remove multiple authors from each post.
For authors we use WordPress taxonomies. So authors are basically terms.
The taxonomy is “author” and the terms are stored in your site's database on the following tables (for the following examples I'm using “wp_” as the table prefix):
- wp_terms: This is the table that stores the terms. Each author will have an entry in this table, both guest and authors mapped to users.
- wp_term_taxonomy: This table stores the taxonomy for the term. Each author has one entry on this table to say the term “belongs” to the taxonomy “author”;
- wp_term_relationships: This table stores the relationships between posts and terms. So on this case it stores the list of posts for each author, or the list of authors for each post.
- wp_termmeta: This table stores the metadata for each author. All the author's information is metadata. The name, email, path to the custom avatar etc. For authors mapped to a user the user_id will be stored as metadata as well. The basic user's data is copied there. You will find multiple rows for each author, one for each information.
- wp_postmeta: We store one register on this table for each post with the name of each author separated by “, “.
PublishPress Authors don't update the “post_author” column in the “wp_post” table. It keeps that column untouched and WordPress stores the user that created the post, by default. So if the plugin is disabled, that is the data WordPress will use to display as author. We can't use that field because it doesn't support multiple user IDs, and don't support a relation to a guest author as well. We just try to make the themes and WordPress ignore it and use our own taxonomy.
PublishPress Authors stores the settings as options in the following table:
- wp_options: Store options for WordPress, themes and plugins. Our plugin stores the following options:
- multiple_authors_version: the current plugin version
- multiple_authors_modules_settings_options: Some internal data for the plugin's modules
- multiple_authors_settings_options: Some internal data for the settings module
- multiple_authors_multiple_authors_options: Some internal data for the multiple authors module
- multiple_authors_default_layouts_options: Some internal data for the module Default Layouts
- PP_AUTHORS_VERSION: the current plugin version
- publishpress_multiple_authors_settings_migrated_3_0_0: An option that says (if exists) the data were migrated to the version 3.0.0
- multiple_authors_author_custom_fields_options: Some internal data for the module Custom Fields (pro)
- multiple_authors_author_custom_layouts_options: Some internal data for the module Custom Layouts (pro)
- multiple_authors_prosettings_options: Settings for the Pro plugin
PS: While copying the data please make sure to not modify the registers' keys to avoid breaking any relationship in the data.