Title: Delete log file
Last modified: June 16, 2025

---

# Delete log file

 *  [Knud](https://wordpress.org/support/users/knud/)
 * (@knud)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/delete-log-file-3/)
 * 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](https://wordpress.org/support/users/bwbama/)
 * (@bwbama)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/delete-log-file-3/#post-18514969)
 * 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](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:
 *     ```wp-block-code
       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](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.

 * ![](https://ps.w.org/wp-smtp/assets/icon.svg?rev=3153456)
 * [Solid Mail – SMTP email and logging made by SolidWP](https://wordpress.org/plugins/wp-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-smtp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Brent Wilson](https://wordpress.org/support/users/bwbama/)
 * Last activity: [10 months, 1 week ago](https://wordpress.org/support/topic/delete-log-file-3/#post-18514969)
 * Status: not resolved