Title: [Plugin: BulletProof Security] Logout Redirection from WordPress 3.4.2 Admin Bar
Last modified: August 20, 2016

---

# [Plugin: BulletProof Security] Logout Redirection from WordPress 3.4.2 Admin Bar

 *  Resolved [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * (@sweetmelody)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/)
 * After upgraded to WP 3.4.2, logging out from WP top admin bar will not redirect
   users to homepage.
 * How to troubleshoot that this is related to BPS or not?
 * Thank you!
 * [http://wordpress.org/extend/plugins/bulletproof-security/](http://wordpress.org/extend/plugins/bulletproof-security/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044851)
 * You asked this question in this thread and you got it working before so follow
   the same steps. I am assuming this is actually a BuddyPress issue and not a BPS
   issue.
    [http://wordpress.org/support/topic/plugin-bulletproof-security-bps-and-buddypress-logout-redirection?replies=5](http://wordpress.org/support/topic/plugin-bulletproof-security-bps-and-buddypress-logout-redirection?replies=5)
 *  Thread Starter [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * (@sweetmelody)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044922)
 * I have followed the steps of the link above before I posted this thread. What
   can I do now? Many thanks.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044924)
 * When i log out of Buddypress i am redirected to the standard WordPress logout–
   example.com/wp-login.php?loggedout=true – BPS is not installed at all on the 
   site i tested BuddyPress on. This is standard BuddyPress logout behavior and 
   has nothing at all to do with BPS. So you will need to contact the BuddyPress
   folks about this.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044927)
 * Oops i forgot to configure my XAMPP vhosts file for the BuddyPress test site.
   the BuddyPress logout does redirect by default to the homepage with BulletProof
   Modes activated and without BulletProof Modes activated so BPS is not interfering
   with this on my test site. there must be something else going on with your particular
   website. in the other comment you posted add your website URL so i can take a
   look at your website and see if there is anything obviously wrong on the frontend.
   Thanks.
 *  Thread Starter [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * (@sweetmelody)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044977)
 * You are so right, the logout redirection has nothing to do with BPS. Here’s a
   link explains that by default, logging out from WP admin bar located above the
   header redirects users to the login page >>> [http://patrick.bloggles.info/2012/01/24/automatically-redirect-to-current-page-after-logout-wordpress/](http://patrick.bloggles.info/2012/01/24/automatically-redirect-to-current-page-after-logout-wordpress/).
 * Somehow, I wonder how it can redirect to the homepage instead to the current 
   page.
 *     ```
       /*
        * Automatically redirect to current page after user logout WordPress.
        */
       function get_current_logout( $logout_url ){
         if ( !is_admin() ) {
           $logout_url = add_query_arg('redirect_to', urlencode(( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), $logout_url);
         }
   
         return $logout_url;
       }
   
       add_filter('logout_url', 'get_current_logout');
       //add_filter('login_url', 'get_current_logout');
       ```
   
 * I have tried to contact the author about the code but it seems that my comment
   can’t be sent. Do not why? 🙁
 * Tried to DIY by changing ‘get_current_logout’ to ‘get_home_url’, ‘get_home_url_logout’
   and ‘get_home_logout’ but none of them work.
 * The question is out of your plugin scope, you don’t have to answer if you are
   unwilling.
 * Thank you!
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044979)
 * Well since you have BuddyPress installed then this changes how you would do the
   redirect. i came across a plugin that will take care of this for you. it is specifically
   designed for BuddyPress logout redirection. If you want to do a DIY solution 
   instead, then in your Google search term you should include “buddypress” example–“
   buddpress logout redirect”
 * [http://buddydev.com/plugins/bpdev-logout-redirect/](http://buddydev.com/plugins/bpdev-logout-redirect/)
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3044981)
 * hmm interesting your logout by clicking the logout on the page works perfectly
   fine and redirects to your homepage, but yes i see that the wp-admin bar logout
   redirects to the default WP logout page. Ok so i think you actually need to do
   some custom DIY coding, but try the plugin above out and see if it will do this
   for you. if you decide to do a DIY then you need to also find a coding solution
   that is specific to the wp admin bar, since logouts from the page are redirecting
   normally. so the search term you would want to use is something like this – “
   buddypress admin bar redirect logout”
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045028)
 * What is the status of this BuddyPress logout issue? Did you try the plugin above
   or find a DIY solution for BuddyPress?
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045042)
 * Any luck with the bpdev plugin or did you find a DIY solution?
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045047)
 * Since this issue/problem is not related to BPS then i am resolving this thread,
   but I will continue to assist you any way i can. You can continue to post new
   status updates or other info and i will continue to receive email notifications
   when you post. Thanks.
 *  Thread Starter [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * (@sweetmelody)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045050)
 * The bpdev plugin did help to redirect to the homepage but a black bar with redirect
   logout url would appear once the mouse pointer was hovered over the site background.
   Hence, decided to uninstall it.
 * I believe that if I could find the DIV code to replace ‘get_current_logout’ then
   it’s a hurray but until now no successful case yet.
 *     ```
       /*
        * Automatically redirect to current page after user logout WordPress.
        */
       function get_current_logout( $logout_url ){
         if ( !is_admin() ) {
           $logout_url = add_query_arg('redirect_to', urlencode(( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), $logout_url);
         }
   
         return $logout_url;
       }
   
       add_filter('logout_url', 'get_current_logout');
       //add_filter('login_url', 'get_current_logout');
       ```
   
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045051)
 * I just did a Google search and i think i found the problem.
 * >  OK.
   >  I have it running.
   > I had to enable ‘Show adminbar on the homepage’ in GenesisConnect Settings.
   > 
   > This displayed the BuddyPress admin bar at the top of my homepage where I was
   > being redirected on logging in. *Then* I was able to use the BuddyPress admin
   > bar to log in to WordPress.
   > This was very confusing.
   > I kept expecting to go straight to the old WordPress admin area after logging
   > in.
 * [http://buddypress.org/community/groups/installing-buddypress/forum/topic/cant-access-wordpress-admin-panel-after-bp-installation/](http://buddypress.org/community/groups/installing-buddypress/forum/topic/cant-access-wordpress-admin-panel-after-bp-installation/)
 * If this is not the exact problem then what this post tells you is that yes there
   is a known problem with Genesis Connect and BuddyPress regarding the wp admin
   bar.
 *  Thread Starter [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * (@sweetmelody)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045060)
 * GOOD NEWS!!!
 * Found [this code](http://projectivemotion.com/2011/07/27/wordpress-always-redirect-to-homepage-after-logout/)
   and voila!
 *     ```
       add_filter('logout_url', 'logout_home', 10, 2);
   
       function logout_home($logouturl, $redir)
       {
       $redir = get_option('siteurl');
       return $logouturl . '&redirect_to=' . urlencode($redir);
       }
       ```
   
 * Before the successful adventure, learnt from GC forum that the plugin had no 
   interference on the logout redirection.
 * Thank you so much for your light! Happy new week! 🙂
 *  [Biswadip](https://wordpress.org/support/users/biswadip/)
 * (@biswadip)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045135)
 * Thank you [@sweetmelody](https://wordpress.org/support/users/sweetmelody/)! 🙂
 *  Thread Starter [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * (@sweetmelody)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045136)
 * Glad it helped! 🙂

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘[Plugin: BulletProof Security] Logout Redirection from WordPress 3.4.2
Admin Bar’ is closed to new replies.

 * ![](https://ps.w.org/bulletproof-security/assets/icon-128x128.png?rev=1731938)
 * [BulletProof Security](https://wordpress.org/plugins/bulletproof-security/)
 * [Support Threads](https://wordpress.org/support/plugin/bulletproof-security/)
 * [Active Topics](https://wordpress.org/support/plugin/bulletproof-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bulletproof-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bulletproof-security/reviews/)

 * 15 replies
 * 3 participants
 * Last reply from: [sweetmelody](https://wordpress.org/support/users/sweetmelody/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-bulletproof-security-logout-redirection-from-wordpress-342-admin-bar/#post-3045136)
 * Status: resolved