Redirect Users to a Custom Dashboard Post-Login in WordPress

I developed a custom WordPress theme with an alternate dashboard. How can I redirect users to updates.php (my new dashboard page) instead of /dashboard/ upon login using functions.php?

hey try add_filter(‘login_redirect’, function($redir, $request, $user){ return site_url(‘/updates.php’); },10,3); in functions.php. works fine in my theme. hope it helps!

In my experience, leveraging the wp_login hook worked well for redirecting to a custom dashboard. I added a function in functions.php that checks for a successful login and then immediately calls wp_redirect to send users to your desired updates.php page. It’s important to use exit after wp_redirect to ensure the redirect process completes properly. Also, verify that no other login or redirection functions are interfering. This method is pretty straightforward and integrates seamlessly within a custom theme.

I have occasionally faced similar challenges when refining my WordPress theme. One approach that proved efficient was to implement the redirect within a function hooked to an action that triggers at login. I checked the user role after they logged in and then used wp_safe_redirect to send them directly to updates.php, followed by an exit call. This method allowed me the flexibility to incorporate additional conditions later on if needed, and it ensured the transition was smooth without conflicting with other redirection rules in the environment.