Automatically Complete all WooCommerce orders

Many people likes to mark WooCommerce orders completed automatically, as soon as they are placed. There is no default option in WooCommerce to do this directly from admin panel. But this is very easy and small customization – a few lines of codes.

 * Auto Complete all WooCommerce orders
 * @param $order_id
function careless_woocommerce_auto_complete_order( $order_id ) {
    if ( ! $order_id ) {

    $order = wc_get_order( $order_id );
    $order->update_status( 'completed' );
add_action( 'woocommerce_thankyou', 'careless_woocommerce_auto_complete_order' );

Code goes in the functions.php file of your active theme.