Home / Admin / Disable Automatic Trash Emptying
Duplicate Snippet

Embed Snippet on Your Site

Disable Automatic Trash Emptying

Prevent WordPress from automatically deleting trashed posts after 30 days.

200+
Code Preview
php
<?php
add_action( 'init', function() {
    remove_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
} );

Comments

Add a Comment