1 comment

  1. Try something like this:

    add_action( 'wp_login','redirect_to_homepage');
    function redirect_to_homepage() {
        // if user is accessing admin page/dashboard do not redirect
        if (is_admin()) {  
            return;
        }
        wp_redirect( get_home_url());
        exit;
    }
    

    Edited to add optional line that does not redirect if user is accessing the Dashboard.

Comments are closed.