How Can I Store the WordPress Audit Trail from Multiple Websites in 1 Central Database

You are here:
Back

This step by step guide explains how you can use the Database & Integration tools to store the WordPress audit log (also known as audit trail) of multiple WordPress websites on a single MySQL database.

The WordPress Audit Log Database Tables

The WordPress audit log that the plugin WP Security Audit Log creates to keep track of all changes taking place on your website is stored in the following tables in your WordPress database:

  • wp_wsal_metadata
  • wp_wsal_occurrrences

Note: the wp_ in the table name is a prefix. Every table in your WordPress database has the same prefix. Refer to the WP Security Audit Log database documentation for more details on how the WordPress audit trail is stored.

Store the WordPress Audit Trail of Multiple WordPress Websites in One MySQL Database

Storing multiple WordPress audit trails from different websites in one central databaseWhen configuring the plugin to store the activity log in an external database specify a different tables prefix for each website, as explained in the following example in which we will save the WordPress audit trial of both the websites wpwhitesecurity.com and www.wpsecuritybloggers.com on the same MySQL database.

  1. When configuring the External Database on the website wpwhitesecurity.com we specified wpw as prefix.
  2. When configuring the External DB add-on on wpsecuritybloggers.com we specified wpsb as prefix.
  3. Once both websites are configured we will have the following the tables in the MySQL database where the audit logs are stored:

That’s it. All you need to do to store the WordPress audit trail of multiple websites in a single database is use a unique tables prefix for each website.