Login Page Redirect Error
-
For some reason the Login page forwards to the Home page. The login page shortcode is added to the page. What needs to be done so the login form page will display properly and not redirect to the Home page.
-
How did you setup the Login redirect?
You have a setting for each Role in
UM User Roles -> Edit -> Login Options -> “Action to be taken after login”.Verify the setting for the UM default Registration Role.
The Subscriber role is set as the default in the WordPress core settings. Here is a screen shot of the current UM settings. Let me know if anything needs to be modified.

You can set the Role Priority too.
https://docs.ultimatemember.com/article/1494-how-to-set-role-priority-for-user-roles
The priority field has been set for all of the user roles with Subscriber being the lowest. The login page still forwards to the Home page, and this is before attempting to login. The login page is not appearing on the screen at all, it just forwards to the Home page. Is there some other setting that needs to be modified?
Set “Custom Redirect URL” to the Login Page in
UM Settings -> Access -> Restriction ContentHi @siriusweb
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards
Greetings,
I am still having the same problem with the Login redirect forwarding to the Home page. Here are some screenshots of the Settings pages in reference. Let me know if any other settings need to be changed.


Hello again,
I am writing to follow up on my last post that included screenshots of the settings/configurations. The login page still redirects to the Home page. Is there another way to fix this problem directly in the code? If yes, please indicate where because none of the suggestions provided are working.
You can try this code snippet which will write to
/wp-content/debug.logthe source of your redirects.Install the code snippet to your active theme’s
functions.phpfile
or use the “Code Snippets” plugin.https://ww.wp.xz.cn/plugins/code-snippets/
add_filter( 'x_redirect_by', 'wp_redirect_custom_log', 10, 3 ); function wp_redirect_custom_log( $x_redirect_by, $location, $status ) { $traces = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); $plugin_trace = array(); foreach ( $traces as $trace ) { if( isset( $trace['file'] ) && strpos( $trace['file'], '/plugins/' ) > 0 ) { $file = explode( '/plugins/', $trace['file'] ); if( substr( $file[1], 0, 22 ) != 'wp_redirect_custom_log' ) { $plugin_trace[] = $file[1] . ':' . $trace['line']; } } } $trace = date_i18n( 'Y-m-d H:i:s ', current_time( 'timestamp' )); $trace .= 'redirect by ' . $x_redirect_by . ', ' . $location . ', ' . $status . ', '; $trace .= 'stack trace: ' . implode( ', ', $plugin_trace ); file_put_contents( WP_CONTENT_DIR . '/debug.log', $trace . chr(13), FILE_APPEND ); return $x_redirect_by; }
The topic ‘Login Page Redirect Error’ is closed to new replies.