Disable scheduled posts in WordPress

Disable scheduled posts in WordPress

Add this code to function.php and you can disable option that future publishing date make post scheduling.

function onetarek_prevent_future_type( $post_data ) {
if ( $post_data[‘post_status’] == ‘future’ && $post_data[‘post_type’] == ‘post’ )
{
$post_data[‘post_status’] = ‘publish’;
}
return $post_data;
}
add_filter(‘wp_insert_post_data’, ‘onetarek_prevent_future_type’);
remove_action(‘future_post’, ‘_future_post_hook’);

Twitter
Facebook
LinkedIn
Telegram
WhatsApp
Email