skip to Main Content

I am looking for a way to stop WooCommerce from redirecting the user to the welcome screen upon the plugin activation.

enter image description here

Does anyone have some code to do that?

2

Answers


  1. Chosen as BEST ANSWER

    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' );
    

  2. You could try this instead:

    add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
    

    Same effect using an existing filter.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search