Logout Redirect plugin for WordPress Multisite/BuddyPress
I am glad to introduce our another free plugin "BPDev Logout Redirect" for WordPress Multisite and BuddyPress.
So what It does
- For WPMU, redirect users to main site, when they logout
- For BuddyPress, if the user is logged in at back end, he will be redirected to the front page of the site on which BuddyPress is enabled. For the user not logged in the backend, BuddyPress already redirects them to main site on logout.
So, It is basically a simple plugin, allowing you to redirect your user to the main site while they logout.
I have used the filter "logout_url" to manipulate it, anyway, It was just a few lines of code.
Download Link
https://buddydev.com/plugins/bpdev-logout-redirect/
Installation
1.Unzip the plugin bpdev-logout-redirect.zip
2.Upload it to wp-content/plugins
3.Go to Dashboard->Plugins->Installed
4.Activate BpDev Logout redirect Sitewide
That's it.
Hope It helps.
Let me know in comments whether it worked for you or not or if you found any problem.
This plug in worked like a charm and did exactly what I needed. Thank you very much!
hi Frank, Thanks for the comment. I am glad It worked 🙂
I uploaded and activated the plugin, and after that my adminstrations sit just turned whrite. So now I can't do anything. I can not even remove the plugin again. What can I do?
Daniel
This plugin should not cause any issue with bp 1.2. I had updated it for bp 1.2.
Still, you can simply delete the plugin using ftp, delete it from wp-contents/plugins and it will be automatically deactivated.
I will be interested to know, what caused the conflict.
Thanks
Brajesh
Hello!
Thanks for all the great plugins!
Question. How can we modify your plugin so when they hit logout they get redirected to a logout page or at least a message is set on the home screen saying its logged out?
Thank you!
hi Giovanni
add a line after line 33 and before 37 as
$redirect="where you want to redirect";
Also for showing a message, you will need to add another line at the bottom(just before return statements ass)
bp_core_add_message("You have logged out successfully");
Make sure the line
do_action( 'template_notices' );
is present on the page where you are redirecting user after logout .
I had some privacy plugins with buddypress but when a user logged in and then logged out, everything was still viewable if the page wasn't refreshed. Imagine this on a public computer. I found your plugin and put it in my ftp. It didn't show up in my admin to activate but it still works. Clicking logout anywhere now redirects to the login. Cool.
Hi Stacy,
Thanks for the comment.
I am glad it is working for you.
It seems to me, you have uploaded the plugin to the mu-plugins directory, so It is automatically activated sitewide.
I noticed this plugin was last updated in 2009 – is this plugin compatible with WP3.1 and BP 1.2.8?
Hi Miko,
As far as I tested, It worked. Since there is a very small code and nothing change during the bp updates, so I did not updated this plugin. It should work without any trouble.
Hi Admin !
When i'm trying what you said about redirecting to a personnal page, that doesn't work.
I put the like as following :
$args = array( 'action' => 'logout' );
if ( !empty($redirect) ) {
$args['redirect_to'] = $redirect;
$redirect="http://bl.ee/mypage";
}
and add
in the page
What's wrong ?
Thank you very much,
Mathieu
Sorry, Could you delete my last comment ?
I talked about
do_action( 'template_notices' );
Hi Mathieu ,
I am sorry but I still could not understand the question. can you please explain again?
bro thats cool oo, its still working in 2016. thumbs up…
Thank you 🙂