• I have almost 5000 pages in my log and can only delete one page at a time. How can I delete the whole log?

Viewing 1 replies (of 1 total)
  • Plugin Support Brent Wilson

    (@bwbama)

    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.

Viewing 1 replies (of 1 total)

The topic ‘Delete log file’ is closed to new replies.