Speedup WordPressLogin-logoutDonateGitHub

WordPress plugin: widget with login or logout link. It is the replacement of the default Meta widget.

"Login Logout" plugin add widget with login or logout link.

If user is not logged in there are two links:

  • login (after login action user will return to previous page);
  • register (if user can register) (if checkbox is active);

If user is logged in there are two links:

  • logout (after logout action user will return to previous page);
  • site admin (if checkbox is active);


  • Spanish translation made by Maria Ramos from WebHostingHub
  • Serbian translation made by Borisa Djuraskovic from WebHostingHub

If you need "login-logout" link you can use this code without the plugin:

<?php wp_loginout( get_permalink() ); ?>

If you need "register-admin" link you can use this code without the plugin:

<?php wp_register('', ''); ?>

121 comments on “Login-logout

  1. Pingback: UaMV on “[Plugin: Lara, Google Analytics Dashboard Widget] Exclude Analytics Code for Logged-In Users” – من خوشحالم

  2. When a new user clicks on register it opens into a screen asking for user name and email address but no option for adding a password. How can i make it ask a new user to add a password to their account?

  3. nice plugin. But please how can i change the login and logout and username link address to another page already created.

  4. Can you please fix the initalization of $redirect_to_self so that the plugin can be used for a wordpress site that is only accessible via https. Currently there is 'http://' hard coded.

    You could use the variable $_SERVER['HTTPS'] which is set to 'on' if https is used for access.

    Thanks in advance.


      1. Wow, that was fast! I did not expect such a fast change.

        I upgraded today and found it working.

        Thank you very much!

  5. Hi there,
    Using your plugin on my site and it works great - thank you! As a suggestion, I have changed line 69 in login-logout.php from

    $username_link = ''.$username.'';


    $username_link = apply_filters( 'login_logout_username_link', ''.$username.'', $current_user );

    Would you consider including that in the next version? I am using the filter to change the username link to display first name instead of login and to change the link to a different front end user profile page. Obviously I'd love it if you included the filter so I don't have to amend the file again when you update...


  6. Unsophisticated coder here. What would I need to alter to remove the bullets before each link? I like the inline appearance without it, but would like to retain a vertical presence. Thanks in advance!

    1. webvitaly

      Try to add these css styles:

      .wrap_login_logout li { list-style-type: none; }

  7. Pingback: Antivirus Software Blog » Login Logout 2.6

    1. webvitaly

      This redirect could be made by some other plugin.
      Check out all your plugin and try to find the plugin which could be responsible for this redirect.

  8. hi plz help me...tomorow is my presentation on a web site in wordpress but i dnt knw how can i create login and logout feature for user and also how user registerd on my blog

    1. Activate Login-logout plugin and add Login-logout widget to sidebar. You may check out how it looks on screenshot page.
      You can enable registration here: "site.com/wp-admin/options-general.php" option called "Anyone can register".
      Login page you can find here: "site.com/wp-login.php".

      1. what do ou mean by :
        You can enable registration here: "site.com/wp-admin/options-general.php" option called "Anyone can register".
        Login page you can find here: "site.com/wp-login.php".
        plz explain

        1. You should visit this link "site.com/wp-admin/options-general.php" and enable option "Anyone can register". "site.com" you should change with your own site.

  9. Hi I'm just wondering is there a way to have the login link directed to a front end login page that I have instead of the backend wp-login.php? Thanks.

    1. You may update your version of the plugin for your needs. Edit login-logout.php file. Also change version of the plugin to "100" for avoiding plugin updates and preventing losing your code.

      1. Thanks so much for getting back to me so quickly. I'm sorry but I don't know where in the code I need to change to link, can you tell me where?
        Thanks again!

  10. Hey there,

    Could you update the plugin, I recently install 3.4.2 and now the plugin isnt working correctly. on my phone, its not reading the login at all and not redirecting me to the page i selected. When i log out, its not letting me log out.

    1. Hey there,

      I think i put the wrong code in and thats why its not working on my smartphone.

      $username_link = '<a href="'.home_url('index.php').'" rel="nofollow">'.$username.'</a>';
      $welcome_text_new =

      I remember that i told you i didnt want it to link back to the admin bar and this was the code i needed to change. on my phone, when i login, its not redirected me to the page I want it to. do i change index.php to profile?

  11. Hey there,

    How would I add facebook twitter, g+ into the login widget? Would i copy the html code from another plugin Im using and add it to the code? if so, where would I add it?

    1. You may insert your code into the login-logout.php into line #112.
      Also change the version of the plugin to "100" for avoiding plugin updates and losing your code.

  12. Hi!

    Is there a way to make the Login-logout appear in the header? Maybe perhaps a php shortcode for it to appear?

    Would appreciate your help.


  13. charlie

    Hey there,
    I'm using buddypress and wanted to know how would I redirect users their members profile after they login?
    Here is an example link to get to the screen I want.

    But how would I set it up for any user who login go to their profile page?

    1. webster

      Sorry, but this is not possible to do with Login-Logout plugin now.
      If you want, you may extend it and I will include this into next versions of plugin.

  14. charlie

    Hey there,

    I finally putting the main site up and I ran into the problem you forewarn me about in may, Since the updates, I have lost redirecting aspect. What line do i use to increase plugin version to 100? and why when I use the widget redirect link after user login, its not working and takes me to the dashboard?

    1. webster

      You should change plugin version to "100" in 6-th line in login-logout.php file.
      What link do you set (when it is not working) as link for redirect?

      1. charlie

        so where it say 2.3 I put 100?

        Im putting the redirect in the widget area (redirect to this page after login) It worked before but now Its not working at all

        1. webster

          "so where it say 2.3 I put 100?" - yes
          Please, write here the full link, which are you using for redirect.

  15. charlie

    Fyi, I still have to do some work on where I want to direct it but I changed the admin_url to home_url which is working at the moment. Thanks again!!!

  16. charlie

    Hey there,
    Great plugin, How would I redirect the username link (welcome mike)to the site profile instead of the wp dashborad? Dont want users to have access of the dashboard period.


    1. webster

      There is no such possibility now. You may change it manually. Check file login-logout.php line-72. Also increase plugin version to 100 for example for avoiding plugin updates and your code losing.

      1. charlie

        Thank you so much for the prompt response. Ok, Im really new to all this.
        $username_link = ''.$username.''; Would i change it to buddypress profile php?

        I want it to go to mysite/members/'.$username' I think

          1. charlie

            I lost all content when I use that. Do i keep the code and just change admin_url part or change everything in the link section?

            1. webster

              Yes, keep the code and just change the admin_url() section. Good luck ;)

              1. charlie

                Thanks I will figure it out, Thanks for your time. really appreciate. Hopefully I wont need to more :-)

  17. Thanks bro for fast reply. Very2 appreciate it.

    One more question, How to make it display in center and bold?

    1. try to add this css styles into your style.css file:
      .wrap_login_logout {text-align:center; font-weight:bold;}

Leave a Reply to Aoife Cancel reply

Your email address will not be published. Required fields are marked *