Hello Knud,
Glad you reached out here regarding this!
Currently the method you are using is the only way to delete log entries but I have opened up a feature request to get this added here: https://solidwp.featureos.app/p/allow-clearing-all-solid-mail-log-entries
In the meantime, you can add the following to your functions.php file:
add_action( 'admin_init', function() {
if ( current_user_can( 'manage_options' ) && isset( $_GET['clear_solidmail_log'] ) && $_GET['clear_solidmail_log'] === '1' ) {
global $wpdb;
$table_name = $wpdb->prefix . 'wpsmtp_logs';
// Ensure the table exists
$table_exists = $wpdb->get_var( $wpdb->prepare(
"SHOW TABLES LIKE %s", $table_name
) );
if ( $table_exists === $table_name ) {
$wpdb->query( "DELETE FROM {$table_name}" );
wp_die( 'Solid Mail log table has been cleared.', 'Success', [ 'back_link' => true ] );
} else {
wp_die( 'Solid Mail log table not found.', 'Error', [ 'back_link' => true ] );
}
}
} );
and then while logged in as an admin visit this URL: https://yourdomain.com/wp-admin/?clear_solidmail_log=1
This will clear all your log entries. Once done you can then remove the code from functions.php if you wish, or leave it in place for future use.