Filtering Activity Logs
The Activity Log tab provides a powerful filters bar that lets you narrow down the log entries to find exactly what you need. All filters can be combined for precise results.
Filter by Event Type
- On the Activity Log tab, locate the Event Type dropdown in the filters bar.
- Select a specific event type from the organized groups:
- Logins: Login Success, Login Failed, Logout
- Content: Post Published, Post Trashed, Post Deleted
- Plugins/Themes: Plugin Activated, Plugin Deactivated, Plugin Updated, Theme Switched, Theme Updated, Core Updated
- Users: User Created, User Deleted, Role Changed, Password Changed, Password Reset
- Settings: Settings Saved, Option Updated
- Click the Filter button to apply.
Select “All Events” to clear the event type filter and show all entries.
Filter by User
- In the User text field, type a username (or partial username).
- Click Filter.
The filter uses a LIKE match, so typing “admin” will match usernames like “admin”, “admin2”, “superadmin”, etc.
Filter by Date Range
- Use the Date From date picker to set the start date.
- Use the Date To date picker to set the end date.
- Click Filter.
You can use just one of the date fields (e.g., only “Date From” to see all events after a certain date) or both for a specific range. The date range is inclusive of the full day for both start and end dates.
Combining Filters
All filters work together. For example, you can filter for all “login_failed” events by a specific username within the last 7 days to investigate a potential brute force attack.
Pagination
Results are paginated at 50 entries per page. Navigation controls appear below the log table. The total event count is displayed above the table, updating to reflect any active filters.
Exporting Activity Logs
BD Activity Log supports exporting your log data as a CSV file for external analysis, compliance reporting, or archival purposes.
How to Export
- On the Activity Log tab, optionally apply any filters to narrow the data you want to export.
- Click the Export CSV button in the actions row above the log table.
- A CSV file will be downloaded with the filename format
activity-log-YYYY-MM-DD.csv.
CSV Contents
The exported CSV includes the following columns:
- Date — The event timestamp
- User — The username
- Role — The user’s role at the time of the event
- Event — The event type identifier
- Object Type — The type of object affected
- Object Name — The name of the affected object
- Details — JSON-encoded additional details
- IP Address — The client IP address
Note: The export respects any currently active filters (event type, user, date range). If no filters are applied, all entries are exported. The export is limited to a maximum of 10,000 entries to prevent server memory issues.
Clearing the Log
You can manually clear log entries when needed:
- Click the Clear Log button in the actions row.
- A prompt will ask: “Delete entries older than how many days? (0 = clear all)”.
- Enter a number of days to delete entries older than that threshold, or enter
0to clear the entire log. - Confirm the action. The number of deleted entries will be displayed in a notification.
Warning: Clearing the log is permanent. Deleted entries cannot be recovered. Consider exporting to CSV before clearing.
Settings Reference
Navigate to the Settings tab to configure BD Activity Log. All settings are saved via AJAX and stored in the bdal_settings WordPress option.
Enable Logging
The master toggle that enables or disables all activity logging. When disabled, no new events are recorded regardless of individual category settings. Default: enabled.
Event Category Toggles
Each event category can be independently enabled or disabled:
| Setting | Default | Events Controlled |
|---|---|---|
| Log Logins | Enabled | login_success, login_failed, logout |
| Log Content Changes | Enabled | post_published, post_trashed, post_deleted |
| Log Plugin/Theme Activity | Enabled | plugin_activated, plugin_deactivated, plugin_updated, theme_switched, theme_updated, core_updated |
| Log User Management | Enabled | user_created, user_deleted, role_changed, password_changed, password_reset |
| Log Settings Changes | Enabled | option_updated (for tracked options: blogname, blogdescription, siteurl, home, admin_email, users_can_register, default_role) |
Tip: If you want to reduce database growth on a busy site, consider disabling event categories you do not need. For example, on a site with many content editors, you might disable “Log Settings Changes” if settings rarely change.
Log Retention
Controls how long log entries are kept before automatic deletion. Enter a value between 1 and 365 days. Default: 90 days.
The retention policy is enforced by a daily cron job (bdal_daily_cleanup) that runs once every 24 hours. On each run, it deletes all log entries with a created_at timestamp older than the configured number of days.
Daily Cleanup Cron
BD Activity Log registers a daily cron event (bdal_daily_cleanup) that automatically purges old log entries based on your retention setting. This cron is:
- Scheduled on plugin initialization — If no scheduled event exists, one is created on the next page load. The first cleanup runs approximately 24 hours after the plugin is activated.
- Self-maintaining — The cron uses WordPress’s built-in
dailyrecurrence, so it re-fires every 24 hours automatically. - Cleared on deactivation — When the plugin is deactivated, the
bdal_daily_cleanupcron hook is removed. Your existing log data remains in the database.
Note: WordPress cron is triggered by site visits. On low-traffic sites, cleanup may not run at the exact scheduled time but will execute on the next visitor after the scheduled time has passed.
License Requirements
BD Activity Log requires a valid license for event logging to be active. Here is how licensing affects the plugin:
With a Valid License
- All enabled event categories are actively tracked and logged.
- The Activity Log tab displays real-time logged events.
- Filtering, export, and clear functions work fully.
- Daily cleanup runs per your retention settings.
Without a License
- No new events are recorded. The logging hooks are not registered when the license check fails.
- Existing log data remains fully accessible — you can still view, filter, export, and clear previously recorded entries.
- A “License Required” notice is displayed on the Activity Log and Settings tabs with links to activate or purchase a license.
- The daily cleanup cron still runs, so old data will continue to be purged per your retention settings.
License Tiers
| Feature | Starter | Professional | Agency |
|---|---|---|---|
| Sites | 1 | 3 | Unlimited |
| Activity Logging | Yes | Yes | Yes |
| CSV Export | Yes | Yes | Yes |
| Auto Cleanup | Yes | Yes | Yes |
| Priority Support | No | Yes | Yes |
All core features (logging, filtering, export, cleanup) are available on all tiers. The difference between tiers is the number of sites you can activate and access to priority support.
Database Details
BD Activity Log stores all events in a single custom database table: {prefix}_bdal_activity_log (e.g., wpid_bdal_activity_log). The table is created via dbDelta() during plugin activation and includes indexes on event_type, user_id, and created_at for fast querying and filtering.
IP Address Detection
BD Activity Log intelligently detects the client’s real IP address by checking the following headers in order:
CF-Connecting-IP(Cloudflare)X-Forwarded-For(proxy/load balancer — first IP in the comma-separated list)X-Real-IP(nginx reverse proxy)REMOTE_ADDR(direct connection)
Each candidate IP is validated using PHP’s filter_var() with FILTER_VALIDATE_IP before being stored.
Deactivation Behavior
When BD Activity Log is deactivated, the daily cleanup cron is cleared. All log data, settings, and the database table are preserved so they remain available if you reactivate the plugin later.