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:
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
- 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.
- 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. When configuring the External DB add-on on the website wpwhitesecurity.com we specified wpw as prefix. When configuring the External DB add-on on wpsecuritybloggers.com 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:
- wpw_wsal_metadata and wpw_wsal_occurrences in which the WordPress audit trail of www.wpwhitesecurity.com is stored.
- wpsb_wsal_metadata and wpsb_wsal_metadata wn which the WordPress audit trail of www.wpsecuritybloggers.com is 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.