I am looking for a way to stop WooCommerce from redirecting the user to the welcome screen upon the plugin activation.
Does anyone have some code to do that?
2
Okay, I figured it out. If anyone else needs help with this the code is below.
//Old Solution: Stop WooCommerce redirect on activation // function woocommerce_no_redirect_on_activation() { // delete_transient( '_wc_activation_redirect' ); // }; // add_action( 'init', 'woocommerce_no_redirect_on_activation');
Edit: anikitas answer is better. I accepted their answer as the best solution:
//Stop WooCommerce redirect on activation add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
You could try this instead:
add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
Same effect using an existing filter.
Click here to cancel reply.
2
Answers
Okay, I figured it out. If anyone else needs help with this the code is below.
Edit: anikitas answer is better. I accepted their answer as the best solution:
You could try this instead:
Same effect using an existing filter.