DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.


  1. I used this code but I think there is some error…

    I can see the login box in my sidebar but the login field is not empty but show this line:

    how can you fix this?

  2. You can see that there is an extra “<" at the beginning of this code. Remove it and all should be fine.

  3. @luca: I think there is an extra < in the beginning of the code. I haven't tried the script but it should start <?php not <<?php

  4. hey 🙂
    that’s probably a very wimpy question,
    but would somebody please tell me how to create the function that users have to use a login&password to read my wordpress blog?

  5. hey, the logging in part works fine, but when i click the log out button, it tries to redirect me somewhere and shows this “[an error occurred while processing this directive]”

    actually, i’ve tried logging out a dozen times on 1 time it completed the process……any ideas?……this is what it puts in the url when i get the error: /%2Fcms%2F

  6. @bob :

    i think that href value of url from “a” html tag maybe error or something else

    you can change the href value from:

    to something like this:

    Reference :

  7. How can I create a Login with oauth active? I usually have it on standard login page, but what about doing that into frontend? Thanks 🙂

  8. My way to do this would be to install the ‘Shortcode Exec PHP’ plugin

    using that plugin create a new short code [login] with the following:

    wp_login_form( $args );

    now when ever you use the short code [login] any where on your wordpress site the default login box appears.

  9. Thanks for the tip Stevie – exactly what I’d been searching high and low for….

  10. Great tutorial. I love it. Thank you.

  11. How do I make the log-in buttons function correctly?… When I click on them now, nothing happens.

  12. FYI, I was able to make it work when I changed




  13. Could you explain me how can i put into login forms messages (Example: “insert pass”).
    when put the cursor into form the message disappear.
    (Like this form “Your name”, “Your email” and “your site”)

  14. What about the (!(current_user_can(‘level_0’)) function, this is undefined …… Please let me know, and i am new to wordpress

  15. I really need this plugin but it seems not working.. :((

    custom page output below:

    Recover password


  16. The code provided works perfectly in localhost, but when I upload it to Live Server it doesn’t work ! I have updated permalinks. But after pressing the Send button it reloads the same page without logging in.

  17. You can also just insert the following function into your page or post:
    <?php wp_login_form(); ?>

  18. pls where am i to paste this code

  19. Hi, just a quick question. How wuld I go about to make this redirect to the same page, and not wp own page, when entering the wrong password etc?


  20. Hi,

    I am searching for a login solution that I can add to a theme template page…
    I have seen in several places that people recommend using wp_login_form( $args );
    However no one as yet has mentioned validation.
    If I don’t fill in any of the fields…or fill one of them in incorrectly… I am redirected to the wp-login.php page. this pages handles validation nicely.
    Can anyone advise on how to add this type of validation to a custom login form?

    many thanks


  21. I read several posts on creating a custom login form for the current theme being used. But majority of those posts also emphasized on the css part [Example: custom_login_css]. Will it work properly without the styling part? Just needed a nod before I could use this.

  22. I used this code for login/sign up form which will show every post.

    ‘form_id’ => ‘loginform-custom’,
    ‘label_username’ => __( ” ),
    ‘label_password’ => __( ” ),
    ‘label_remember’ => __( ” ),
    ‘label_log_in’ => __( ‘Log In’ ),
    ‘remember’ => false
    wp_login_form( $args );
    } else {echo ”.’Welcome ‘.$current_user->user_login .’ You are logged in!’.”;
    wp_loginout( site_url() );


    This code working well to my localhost but don’t working to my site http://techupdatexxxnews24.com/taha_habib/ showing an error what’s the solution please.

Leave a Comment

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