Redirect WordPress Users After Login

In this tutorial, we’ll be implementing a code snippet that will help users redirect to a specific page of their choice right after they log in.

You can add this code to your functions.php file in your WordPress child theme. Alternatively, if you prefer a safer method, use a plugin like Code Snippets.

function ts_custom_login_redirect() {
    return home_url(); // Corrected: Remove quotes to return the actual URL
}

add_filter('login_redirect', 'ts_custom_login_redirect');