How Can I Store the WordPress Audit Trail of Multiple Website in One Central Database

You are here:

This step by step guide explains how you can use the External DB add-on 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 database

  1. Install the External DB add-on on every WordPress website or blog you have. The External DB add-on for WP Security Audit Log enables you to store the WordPress audit log in an external MySQL database.
  1. 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 and on the same MySQL database. When configuring the External DB add-on on the website we specified wpw as prefix. When configuring the External DB add-on on we specified wpsb as prefix. 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.