Features Provided
How to Manage Logify Activity Logs with WP-CLI
Prefer the command line to the dashboard? Logify ships a WP-CLI command, wp logify clear, that removes activity log entries by user, event type, event ID, or all at once. It is not required for normal use, but it is fast for maintenance and easy to script on development, staging, and managed hosting.
What Is the Logify WP-CLI Command?
Logify registers a single WP-CLI command, wp logify clear, which deletes activity log entries directly from the database. It runs only when WP-CLI is available and is included in the free version of Logify.
The wp logify clear Command
Run the command from your WordPress environment. It accepts these flags:
| Flag | What it does |
|---|---|
--all |
Removes every activity log entry. |
--user-id=<id> |
Removes logs for a specific user ID. |
--event-type=<type> |
Removes logs of one event type. Can be combined with --user-id. |
--event-id=<id> |
Removes logs with a specific event ID. |
Valid event types are: user, security, post, attachment, comment, plugin, theme, term, menu, widget, and option. You must pass either --all or --user-id (optionally with --event-type); running the command with no arguments returns an error.
Clear All Logs
wp logify clear --all
Clear Logs for One Event Type
wp logify clear --event-type=comment
Clear Logs for a Specific User
wp logify clear --user-id=42
Clear Logs by Event ID
wp logify clear --event-id=1001
Combine Filters for a Targeted Cleanup
wp logify clear --user-id=42 --event-type=comment
Why Use WP-CLI?
The command line is useful when you need:
- Faster maintenance on large logs
- Scripted or automated cleanup
- Server-side workflows without the dashboard
It is especially handy on development sites, staging sites, and managed hosting where you already work in the terminal.
When to Avoid It
wp logify clear permanently deletes entries and there is no undo. If you are not comfortable with terminal commands, or you may need the records later, use the dashboard instead and export the log first. See How Can I Download My Website Activity Report?.
Conclusion
wp logify clear gives developers and administrators a fast, scriptable way to remove activity logs by user, event type, event ID, or in full. Because deletions are permanent, export anything you need to keep first, and for hands-off trimming, configure a Log Retention Period instead.
FAQs
What WP-CLI commands does Logify provide?
Logify provides one command, wp logify clear, which deletes activity log entries. It supports --all, --user-id=<id>, --event-type=<type>, and --event-id=<id> flags. The command is available in the free version and runs only when WP-CLI is installed in your WordPress environment.
How do I clear all activity logs from the command line?
Run wp logify clear --all in your WordPress environment. This permanently deletes every activity log entry. There is no confirmation prompt and no undo, so export the log first if you might need the records. In the dashboard, the equivalent is the Clear All Logs button under Settings → General → Maintenance.
Can I delete logs for just one user with WP-CLI?
Yes. Run wp logify clear --user-id=42, replacing 42 with the user's ID, to remove that user's activity. Add --event-type= to narrow it further — for example, wp logify clear --user-id=42 --event-type=comment clears only that user's comment activity.
Is the WP-CLI command available in the free version of Logify?
Yes. wp logify clear and all of its flags are included in the free version of Logify. It requires WP-CLI to be installed on the server; the command is registered only when WP-CLI is running, so it does not appear or interfere in the standard WordPress admin.
Which event types can I use with --event-type?
The valid event types are user, security, post, attachment, comment, plugin, theme, term, menu, widget, and option. These match the event categories used by Logify's filters. Values like "login" or "deleted" are not event types — login activity falls under the user event type. See Event Reference for the full list.