BuddyDev

BP Redirect to profile Plugin :redirect Users to their profile on Login on buddypress sites

This is a free plugin for buddypress based sites, just a follow up from my earlier post about redirecting the user to their profile on login.
So What this plugin does

  • Redirect a user to their profile, whether they login through yoursite.com/wp-login.php or any other page(In buddypress , we usually see a login box at all site pages :))
  • If site admin is logging in from front page of site, redirect back to front page.
  • If site admin is logging from the site back end, i.e site.com/wp-login.php, send him to dashboard(wpmu dashboard)

If you have not yet read that article, read it here
https://buddydev.com/buddypress/buddypress-trick-redirect-users-to-their-profile-on-login/

Download The Plugin Here

Update: This plugin can be downloaded from the official wordpress plugin repository here and Now it supports Buddypress 1.2  🙂

http://wordpress.org/extend/plugins/bp-redirect-to-profile/

Please rate this plugin there. If you are giving a negative rating , Please let me know using wordpress.org forums why? what was the problem.

I will appreciate your feedback.

Installation

1.upload the plugin bp-redirect-to-profile to wp-content/plugins
2.Activate Sitewide and you are done. Easy!

Let me know if you get any trouble.

82 Responses to BP Redirect to profile Plugin :redirect Users to their profile on Login on buddypress sites

  • Hi Brajesh, this plugin does exactly what it is supposed to, but I noticed that it is overriding the title of my home page. I am getting Profile of as the title of my home page, instead of my site name. If I’m logged in as either an administrator or a normal user, the home page title still says Profile of with no name attached. If I go to the actual profile page, it fills in the name.

    I would like to have my normal title on my home page. Any suggestions? I should also point out that I am using the SEO for BuddyPress plugin, which is successfully renaming the titles of all my other pages, except the home page. If I deactivate your plugin, the homepage title returns to normal.

    Please let me know if you have a solution for this!

    Thanks,
    Mike

    • hi Mike
      Thanks for the comment and pointing the issue.
      I will try SEO for BuddyPress plugin with this plugin and will update you tomorrow. If it needs to be updated, I will update it.
      Thanks
      Brajesh

    • btw, you mentioned it in wrong post, and I inadvertently deleted this comment too, so I had to re create your comment from the DB .

  • Pingback:Buddypress trick:Redirect Users to their profile on login | Buddy Dev

  • Pingback:Redirect your users to their profile ,when the login to your buddypress site | Thinking In Wordpress:-Delving deep into wordpress

  • Pingback:Logout Redirect Plugin for wordpress mu/buddypress | Thinking In Wordpress:-Delving deep into wordpress

  • Is there a way to have the redirection take you to the home page?

    • hi Alex, sorry, I missed this. I thought I answered it in another post somewhere. You need to use bp_get_root_domain() instead of bp_get_user_domain(). replacing will make it work.

  • Hi Brajesh,
    Major code changes indeed in BP 1.2 stable. The plugin was working as advertised – redirecting to their profile pages – till I upgraded to BP 1.2 stable this morning. Now users get:

    Hi, sorry for the inconvenience. We are currently fixing the redirection to your profile page.
    Click here to return to main site or Log out
    Thank you.

    after they logged in.

    Thanks.

    • hi Mercime
      Thanks for Pointing. I am looking at the code and going to try it on Bp 1.2. I will put an update tonight 🙂

    • hi Mercime
      here is a temporary solution
      change this line
      add_filter("login_redirect","bpdev_redirect_to_profile",10,3);

      to
      add_filter("login_redirect","bpdev_redirect_to_profile",100,3);

      We are delaying the call.
      This should make it work.

      Thanks
      Brajesh

      • Bravo Brajesh, it's working again. Three Cheers 🙂

  • Hey, I'm trying to get your plugin working, though having problems both with the plugin and hardcoded versions.

    If I use the plugin, simply nothing happens. It activates but makes no difference.

    If I code it myself as you direct, editing the bp-custom.php file, the site fails to load at all – just a blank screen, no errors.

    Any ideas?

    Thanks,
    AJ

    • hi AJ
      I am sorry to hear that.
      Can you please specify which version of buddypress+wordpress/wpmu you are using.
      that will help to diagnose the problem.
      In bp-custom, you might have some syntax issues, that's why site stops working, the plugin version should work.

      • That's the exact problem I'm having…

        MU 2.9.2.
        BP 1.2.1

        Activated sitewide and nothing and adding to bp-custom simply 'whites' the screens.

        • Ok… just tested the fix "add_filter(“login_redirect”,”bpdev_redirect_to_profile”,100,3);" in the bp-custom.php and worked!

          Now on to redirecting to user activity stream.

  • @Berry
    I am glad it worked. I will give it a try at my local and see why the updated plugin did not work for you.

    • And if you wanted to direct user to their Activity stream:

      return bp_core_get_user_domain($user->ID).BP_ACTIVITY_SLUG;

      and so on.

      BTW…thanks for writing this script!

  • Hi brajesh I want to redirect the users to their activity page. And what more is when a logged in user try to access the homepage he is always redirected to his activity page. Is there any process?? Just plz send me. And say how is my site????

    • hi Soubhik
      Please change line 35 to

      return bp_core_get_user_domain($user->ID).BP_ACTIVITY_SLUG;

      as pointed above by Berry.
      Thanks
      Brajesh

  • Hi Brajesh. Firstly, thanks for the great plugin – it's exactly what I was looking for.
    Secondly, I'm here to verify that the current version (1.1) of your plugin works flawlessly with WordPress 2.9.2 and BuddyPress 1.2.4.1.
    Thanks once again for an excellent simple plugin that works!

    • Thanks Nathan for the comment and verifying it's working with the recent version 🙂

  • But will it redirect all the users to their activity page who want to access the homepage????? I dont want to show the homepage to the logged in users. When they want to access the home they are just redirected to their activity.

  • Love this plug in. Thanks very much for developing it.

    One question — or is it a request? Instead of redirecting to a members' personal Activity page, is there a way to redirect them to the page showing their friend's Activity?

    This would be more along the lines of what Facebook does.

    By the way, it is working fine on my install — WPMU 2.9.2 and BP 1.2.4.1. I modified an existing WooTheme (boy that has been a lot of fun!).

  • Hi Brajesh,

    Great plugin and just what I was looking for. Except, I'd like to redirect folks after login to the Acivity page for their friends — just like Facebook.

    Can you tell me what I would need to change in the code?

    Thanks in advance!

    • Thanks for the comment Marty

      change the line

      return bp_core_get_user_domain($user->ID);

      to

      return bp_core_get_user_domain($user->ID).BP_ACTIVITY_SLUG."/friends";

      That should make it happen.

  • Tom #

    It works, thanks!

  • how would i redirect to the current page? if logging in from any login form on the network, meaning sub blogs share the bp login form in the header. would like for the redirect to go to whatever the current page they are on.

  • you are awesome! thanks so much for this

  • hi,

    I use your plugin for a new community i'm building for anglers.

    I noticed that when working with multi-site the plugin doesn't work anymore because of the .htaccess file redirecting everything to the index file.

    Could you be so kind to advice me what to add to the .htaccess file so that your plugin works again ?

    thanks.

    • Hi Alex, have you changed your .htacess file manually or it is what comes with wordpress?

      • Brajesh,

        It is the .htaccess that is generated after enabling multi-site.

        Alex

        • Hi Alex,
          I will check today on a new setup and post back. I believe it was working earlier but need to confirm.

    • U probably network activated it. Just regular activate. I had this problem. That fixed it.

  • Pingback:edsysad.org» Blog Archive » Giving Buddypress Try

  • Running Rockettheme Affinity theme on BP 1.2.6 via WP 3.0.1

    Site: http://www.trancefusiondesign.com/sadiedeyscafe.com

    Hi Brajesh. Thank you for the redirect to profile plugin. I've been using it religiously with my BP 1.2.5 sites. Yet it doesn't work on my BP 1.2.6 site. Any advice? With it activated, the member is taken to the home page and not his/her profile page upon login.

    🙂 Eric

  • Hi Brajesh. Please disregard my last post. I realize that the redirect doesn't apply to admins. 🙂

  • Hi,

    I would like to redirect the member to another page I have created when they login, is this possible?

    Thanks!

  • I can't get the plugin to work for some reason! It seems to redirect to:

    http://www.domain.com/?page_id=0

    rather than the profile page. I am using WP-FB Autoconnect for Facebook for the majority of the logins. All of the logging in works fine, but the redirect does not work. Any ideas what might cause this? Thanks!

    • Hi Jake,
      I just tested and It works without wp-fb-connect. Going to check it with wp-fb-connect on one of the live install and will post back. If I find the issue(which is most probably possible), will look to find a solution.

      Thanks
      Brajesh

  • Hi Brajesh:

    Am here once again!!

    I am trying to make your redirect plugin work on my site. It works partly. I am using login with ajax widget on the sidebar, as my theme (suffusion) does not show a login/log out button anywhere.

    When I click "profile" on the widget, it takes me to a "Error 404 – Not Found

    Sorry, the page that you are looking for does not exist," page.

    Could you please help out?

    Thank you so very much;
    Vida

    • Hi Vida,
      I just tested the plugin login with ajax and bp redirect to profile.
      1. since you are logging with ajax, the users will not get redirected to their profile when logged in. Reason, login with ajax does not check where to redirect dynamically using the redirect filter of wordpress, rather it does that by getting the current page url. so, this plugin will not redirect to profile. That makes login redirect pretty useless with login with ajax plugin.

      2. I checked login redirect and login with ajax, and I was able to view profile when clicking on profile link. So, It could be a conflict with some other plugin. you may want to try this by disabling the login redirect plugin.

      Hope that helps.
      Brajesh

  • How do I make the admins login also redirect to profile? I know its probably a simple fix, but I'm not to code savvy.

  • Kim #

    I was wondering if this plugin works with WP 3 and the newest BP? Also will it work with the WP Sidebar Login plugin?

    Thanks!

    • Hi Kim,
      Yes, it does work with wp3+/bp 1.2.x

      Are you asking about the ajax based sidebar login plugin. It won't work with that. The ajax based sidebar plugins use javascript based redirection/refresh as far as I remember and may not work with it. I haven't tested that. If you test, please do let us know the result here.

  • Ayo #

    Served purpose!
    Someone asked if clicking the homepage may also be made to redirect to activity stream of user when logged in. I also need to get this fixed.
    Thank You.

  • Does this plugin work with the latest version of Buddypress? I updated and now I get a fatal error if this plugin is activated. Any suggestions?

  • Sam #

    Hi,

    Posted this on another forum of yours as well. We changed our redirect to the user’s profile, but would now like to eliminate the change. I cannot remember for the life of me where we placed the code – but I do recall actually using a link to /profile.
    Any help would be appreciated. We want to use your plugin, but whatever we did earlier is overriding your plugin completely. I am scouring wp-login, have looked in the theme’s pages, the plugin pages.. nothing yet.

    We should note that our end-goal is to have the user go to the Activity page. I saw a code you posted for it, but again, we cannot override what we originally changed, because we can't locate what we changed. Thanks again!

    • Hi Sam,
      Please check your bp-custom.php. It should be there.

  • Hi your plugin is great.

    What I want to achieve is similar to what Marty ask above but mine should redirect to group the user belongs.

    Should I replace friends with group?

    Thanks in advance.

    • Hi,
      do you want to redirect to user's profile/groups page where all the groups are listed or you want to redirect to any of the group page to which the user belongs ?

      • I want to redirect to the group the user belongs.

  • Hi, Brajesh

    I'm running this (1.1) with The Events Calendar (2.0.6), which creates an events page with the slug events. When logged in however, if I try to access the /events/ page I get redirected to my profile. Do you think there's some conflict here? Have you come across this before?

    I'd appreciate any thoughts you have!
    Stephen

    • Anyone have a thought? Thanks!

      • Hi Stephan,
        sorry I could not reply earlier. No, this plugin will not cause any conflict of that type. It only redirect using login_redirect filet and won't affetc other plugins once the user has logged in.

  • Eli #

    It doesn't seem to do anything at all….

    WP 3.4.2
    plugin 0.6
    It always points to:
    http://constructionlaborsource.com/?page_id=0

    Please help!

    • Sorry for late replies, but it does work on my test install.

  • This sadly no longer works on the 1.7 update

    • Just tested with BuddyPress 1.7 on a multisite setup. It is working properly.
      It will not redirect site admin if they login. It only redirects users other than site admin. Can you please tell me more about your install if that is not the case.

      • My apologies, I had 2 redirect plugins and yours wasn't activated. Yours works like a charm!

  • Buddypress 1.7.2 Can't login… webiste offline, message error is:

    Fatal error: Call to undefined function bp_core_get_user_domain() in /mounted-storage/home127/sub040/sc71376-CUVU/mystitename.tld/wp-content/plugins/bp-redirect-to-profile/bp-redirect-to-profile.php on line 34

  • Problem with buddypress 1.7.2, when i do login i received :

    Fatal error: Call to undefined function bp_core_get_user_domain() in /mounted-storage/home127/sub040/sc71376-CUVU/mywebsite.tldt/wp-content/plugins/bp-redirect-to-profile/bp-redirect-to-profile.php on line 34

    • Hi Carlo,
      Seems like you have upgraded BuddyPress from dashboard and it got deactivated. Please check and see if your BuddyPress is active.

      • Yes, i think buddypress is activate because the "site offline message" plugins run… and going to the mysitename.tld home page i read the page generated from "site offline message" plugin… so buddypress is active and run… but if i try to go at wp-login.php i received "Fatal error: Call to undefined function bp_core_get_user_domain() in /mounted-storage/home127/sub040/sc71376-CUVU/mysitename.tls/wp-content/plugins/bp-redirect-to-profile/bp-redirect-to-profile.php on line 34

  • I get the same thing if BP-Gallery or BP-Links are activated when upgrading to BP 1.7.2. I recommend removing the plugin completely at this point via FTP. Then reinstall the plugin. If you want to be cleaner, restore site from backup then deactivate plugins and begin reactivating AFTER updating to BP 1.7.2.

    • I get the same thing if BP-Gallery or BP-Links are activated when upgrading to BP 1.7.2. I recommend removing the plugin completely at this point via FTP. Then reinstall the plugin. If you want to be cleaner, restore site from backup then deactivate plugins and begin reactivating AFTER updating to BP 1.7.2.

    • Hi Phillip,
      Please rename the plugins which are causing the issue and never try to upgrade BuddyPress from dashboard. It is not recommend. You need to upload a fresh copy of BuddyPress. Activate it. Then activate the plugin.

      never upgrade BuddyPress from WordPress dashboard.

      • I went back to 1.7.1 when this happened a few days ago. No plans to update again until a major release. Still working out bugs and issues with current configuration so updating at this time was probably a bad idea, anyway 😉

  • Fixed : reuploading file wp-login.php in master directory, 're logged in, reinstal buddypress 1.7.2 from http://ftp... all work ok!

  • Hi

    This works well from /wp-login but I am using the SimpleModal Login plugin, where users login from an overlay. The redirect doesn't work using this.

    Any ideas?

  • Brajesh,
    https://buddydev.com/support/forums/topic/redirect-to-profile-plugin-customization/

    Can you help me out with this ASAP? Remember to read the second message in the thread, because the first one didn't handle the PHP code that I pasted well (so I pasted a URL where you can view it). Thanks in advance!

  • thanks for all dvice and links.
    can i have a wp registered user redirected to a buddypress profile page?
    my website is http://www.village24.net

  • hie,
    All your comments and advice are great.However, is it possible to have a user register in wordpress and redirected to a buddypress profile page?

    • Hi Steve,
      Thank you for the comment.
      Can you please explain the work flow. Yes, It is possible and easily doable if I can understand the steps te user will be taking to register.

      Thank you
      Brajesh

  • The plugin used to work alright but recently after Theme-my-login plugin update, it works no more. I deactivated the plugin and used the snippet you provided in the functions.php, but it is still not working.

    I must point out that i use it in a subsite of a multisite.

    Any help?