[resolved] How can I redirect WP Logout page to Homepage (4 posts)

  1. rossiback
    Posted 3 years ago #

    Hi, Thanks for replying, please can you in any way help me with directions on how to redirect wp logout page to to homepage? I have seen the followings but i did know how or where exactly to paste it:

    Logout and Redirect to Current Page

    <a>" title="Logout">Logout</a>

    Logout and Redirect to Homepage

    <a>" title="Logout">Logout</a>

    Again, Thank you!

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code has been permanently damaged/corrupted by the forum's parser.]

    [No bumping. If it's that urgent, consider hiring someone.]

  2. Birgir Erlendsson (birgire)
    Posted 3 years ago #

    if you want to go directly to the frontpage when you logout, place this into your functions.php in your current theme directory:

    function go_home(){
      wp_redirect( home_url() );
  3. Birgir Erlendsson (birgire)
    Posted 3 years ago #

    if you have php >= 5.3 then you can write it in more compact way, by using an anonymous function:


  4. rossiback
    Posted 3 years ago #

    Thank you birgire, you make my day!

Topic Closed

This topic has been closed to new replies.

About this Topic