remove action from woocommerce file

First of all, you have to understand how hooks or more specifically how action hooks work. We use add_action( $name, $callback ) to register an action hook which takes a name and a callback function as a required parameter. And we use do_action( $name ) to run those registered action hooks which has been registered using add_action().

Now, if we want to remove an action hook or more precisely a registered action hook then we will use remove_action( $name, $callback ) which takes the same parameter as add_action(). So, to remove an action you have to know not only the action name but also the callback function name. You should know that there can be multiple actions with the same action name.

Example

do_action( 'wp_enqueue_scripts' ); // Executing action hooks

function op_enqueue_scripts() {
    // ...
}

function op_enqueue_google_fonts() {
    // ...
}

add_action( 'wp_enqueue_scripts', 'op_enqueue_scripts' ); // Register an action hook
add_action( 'wp_enqueue_scripts', 'op_enqueue_google_fonts' );  // Register another action hook

Remove action hook

remove_action( 'wp_enqueue_scripts', 'op_enqueue_google_fonts' );  // Remove an action hook