Skip to:
Content
Pages
Categories
Search
Top
Bottom

Logout redirect from WP admin bar (may be useful)


  • @mcuk
    Participant

    @mcuk

    Hi all,

    If you logout from WP admin bar it takes you to the WP-Login screen by default (at least mine does). If you want it to return you to your website homepage put this in functions.php or bp-custom.php (depending on how you are organising your custom code):

    function go_home(){
      wp_redirect( home_url() );
      exit();
    }
    add_action('wp_logout','go_home');

    Just thought it may be of use to someone 🙂

Viewing 1 replies (of 1 total)

  • @mcuk
    Participant

    @mcuk

    p.s. Reason i needed it in first place was because i wanted the wp admin bar logout to match that of my Buddypress logout buttons.

Viewing 1 replies (of 1 total)
  • The topic ‘Logout redirect from WP admin bar (may be useful)’ is closed to new replies.
Skip to toolbar