Standard / Admin login redirect not working

I have the latest versions of Buddypress and S2 Member installed but am having an issue with users being redirected after log in.

Standard Users: Menu system changes to reflect they are logged in but they are redirected to the last page they were on before login. Not the Login Welcome page I have selected in the General Options.

Admin Users: Menu system does not change, user not directed to dashboard, but simply to the last page they were on before login.

I have read the forums and knowledge base and believe I have tried averything suggested with no luck. My website is www.voiceatthetable.com, I would appreciate any help or suggestions.

Many Thanks

You have a redirect set in your menu option to Sign In to send the user back to the page they were on when they clicked Sign In.

For example, when I clicked Sign In from your Events page, the login URL looked like this: http://voiceatthetable.com/wp-login.php?redirect_to=http%3A%2F%2Fvoiceatthetable.com%2Fevents%2F.

When I clicked Sign In from your Member Options page, the redirect was to the Member Options page.

This is being done on the menu or by another plugin, not by s2Member.

Ah,ha! That would definitely explain things. I will investigate. Many Thanks.

I have been investigating.

The login redirect_to appears to be standard behavior for WordPress?! I have created a brand new WordPress installation (login.ellbrandon.com), with default Twenty Sixteen theme and only 1 installed plugin of buddypress.

The log in / Log out menu buttons both include the redirect_to parameter:

http://login.ellbrandon.com/wp-login.php?redirect_to=http%3A%2F%2Flogin.ellbrandon.com%2F

Is this normal behaviour? Does anyone have this on their WordPress installations?

I’m a bit confused by this so any help appreciated.

Are you using the “Sign Up” menu item from the BuddyPress options on the Menu creation page? THAT might be standard with the redirect, but a menu item for a “link” to the sign up page would not have that redirect.

Sorted! Many thanks, that was the issue.

I was using the BuddyPress sign in / sign out menu options as they came with built in show/hide depending on log in functionality. They never showed the full url so I wasn’t aware they included the redirect function.

I have now created two custom links;

Sign In -/wp-login.php
Sign Out -/wp-login.php?action=logout&redirect_to=URL

I then used the Menu Item Visibility Plugin with this code to show or hide the the menu items;

 !current_user_can('access_s2member_level1')

And all now works as expected. Thanks again.

1 Like