The WordPress Audit Log Database Tables
The WP Security Audit Log uses two tables in the database to store the WordPress activity log:
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 Activity Log of Multiple WordPress Websites in One MySQL Database
The concept for this is very simple – when configuring the plugin to store the activity log in the same external database where the activity logs of other sites are stored, specify a different tables prefix for each website.
The other option would be to enable the setting Use the website URL as table prefix when configuring an external database connection so the unique URL of a website is used as a prefix, thus ensuring there are no conflicting table names.
- When configuring the External Database 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 wpwhitesecurity.com is stored.
- wpsb_wsal_metadata and wpsb_wsal_metadata wn which the WordPress audit trail of wpsecuritybloggers.com is stored.