Questions tagged [login]

Refers to the act of gaining access to a WordPress site, as well as the WordPress account itself.

Filter by
Sorted by
Tagged with
55 votes
12 answers
50k views

Check if wp-login is current page

How can I check if the current page is wp-login.php or wp-signup.php ? Are there more elegant solutions than using $_SERVER['REQUEST_URI'] ?
user avatar
  • 13.5k
47 votes
6 answers
100k views

Can I programmatically login a user without a password?

I'm manually creating users programmatically, and I want to sign in the newly created user. WP makes it easy to access the hashed password, but not the plaintext version. Is there a way to use ...
user avatar
  • 1,217
4 votes
2 answers
7k views

How to use logout function on custom menu link?

All I am using wordpress custom menu, and there is one menu as Logout. I know wordpress Logout function <?php echo wp_logout_url(); ?> But how can i use it in custom menu ?
user avatar
16 votes
4 answers
10k views

SSO / authentication integration with external 'directory service'

I'm about to start working on a prototype for a client - and one of the required features is integration with an in-house user authentication / registration system. This system will act as the ...
user avatar
  • 9,472
29 votes
4 answers
52k views

Is there any way to rename or hide wp-login.php?

Any way to change the wp-login.php url? It seems insecure that everyone that's ever used Wordpress could easily see if your site is using it, and get right to the login page. There used to be a ...
user avatar
  • 651
23 votes
7 answers
75k views

Check if user is logged in using JQuery

I want to execute custom jquery code which shows login dialog to user if he clicks a button and he is not logged in. How could I do that?
user avatar
23 votes
7 answers
58k views

How can I redirect user after entering wrong password?

I'm using wp_login_form() to display login form in a jQuery dialog window. If user enters wrong password, the user is taken to the backend. I don't want that. Is there a way to notify user that he ...
user avatar
  • 2,470
8 votes
3 answers
43k views

How to redirect/rewrite all /wp-login requests

Is there any simple way to have wordpress, php or apache rewrite all urls which involve /wp-admin to /admin? I have added this entry to my .htaccess file: RewriteRule ^admin /wp-login.php [L] ...
user avatar
10 votes
1 answer
6k views

Enqueue a stylesheet for login page and make it appear in head element

I try to style the login page in my theme. Very simple: add_action( 'login_enqueue_scripts', function() { wp_enqueue_style( 'TEST', get_template_directory_uri() . '/css/login.css' ); }); ...
user avatar
  • 104k
18 votes
9 answers
91k views

Login page ERROR: Cookies are blocked due to unexpected output

I have a WordPress website that I recently discovered had this error on the login page: ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the ...
user avatar
  • 197
24 votes
7 answers
39k views

How to login with email only no username?

After searching for a couple of days and reading 2 year old threads I'm having difficulty finding a solution to the problem of having users login by email only. At first I was delighted to see ...
user avatar
29 votes
8 answers
108k views

Can't log in: "ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress."

After a server move, I'm unable to log in to my site. I get the "ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress." error when I try submitting the ...
user avatar
11 votes
3 answers
29k views

Check for correct username on custom login form

I have used Jeff Star's tutorial for creating my own custom login form http://digwp.com/2010/12/login-register-password-code/. It works great, but I have one problem. On the reset password form, if ...
user avatar
  • 4,756
17 votes
7 answers
64k views

Redirect user to original url after login?

I have a function that redirects users to the login page (home) if they're trying to access any other page without being logged in, here's how it works: function restrict_access_if_logged_out(){ ...
user avatar
5 votes
3 answers
8k views

How to change the wp-login.php page title?

I've been using the document_title_parts hook to change the page title for some front end pages. However, this doesn't seem to work for the login, register and password management pages. How can I ...
user avatar
  • 2,987
17 votes
1 answer
30k views

Separate registration and login for different roles

I've set 2 new roles for my site using the "Members" plugin - "sellers" and "buyers". Each role should have its own registration page and login. A visitor can register as both a buyer and a seller ...
user avatar
  • 175
21 votes
3 answers
14k views

Increase of failed login attempts, brute force attacks? [closed]

I Installed the plugin Simple Login Lockdown and since a couple of days ago the database is recording over 200 records by day. I think that is not possible to have my site attacked by so many IP's ...
user avatar
  • 311
16 votes
4 answers
15k views

User registration followed by automatic login

I am using a plugin modified for my purposes. What I am after is after the user has registered for it to automatically log them in and return them to the current page. At the moment it sends them an ...
user avatar
31 votes
2 answers
58k views

Is there a hook that runs after a user logs in?

I am writing a plugin that fetches some extended user info from a remote service and I need it to execute its function each time a user logs in. Is there a hook that gets fired after login that I can ...
user avatar
8 votes
3 answers
11k views

How to prefill the username/password fields on the login page

For a demo environment, I would like to pre-fill the username and password fields of the wp-login form with respectively "demo" and "demo" string. Thus users will just need to click on the "Log-in" ...
user avatar
7 votes
2 answers
24k views

wp_signon() does not authenticate user guidance needed

I use form to send POST request to a page and to login user with wp_signon() in order to authenticate user to my wordpress installation as described in WP documentation: $creds = array(); $creds['...
user avatar
  • 205
7 votes
10 answers
11k views

Unable to login to my wordpress site. reauth=1 redirection loop

There was a similar post to this, however the solution did not work for me. I am having some difficulty logging into my WordPress site. When I attempt to visit example.com/wp-admin, I see the login ...
user avatar
3 votes
2 answers
3k views

share login/logout sessions across two installs?

I'm having some issues sharing the user sessions across two installs. (a) site on http://stolenmx.com (b) site on http://arcade.stolenmx.com I have installed B in the same database as A and I have ...
user avatar
0 votes
1 answer
362 views

How can I do customizations on login, registration and password recovery forms?

There are a couple of answers here basically just linking to a plugin - to be fair there are some more specific ones too. I know there are many possibilities to use different hooks for the ...
user avatar
10 votes
1 answer
5k views

How to show 'login error' and 'lost password' on my template page?

I'm providing front-end login in a template, using the function wp_login_form. It handles the redirection after login and logout pretty neatly! But if the username / password mismatch, or are non ...
user avatar
29 votes
3 answers
97k views

What's the easiest way to stop WP from ever logging me out

After a certain amount of time WP logs out all users and forces them to log back in again. For development environments on my local machine this is obnoxious and absolutely unnecessary. Is there an ...
user avatar
  • 2,883
31 votes
7 answers
69k views

wp_enqueue_script was called incorrectly

I don't know how but now I am getting this error : Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, ...
user avatar
  • 311
7 votes
3 answers
14k views

Adding extra authentication field in login page

I am going to enhance my WordPress authentication page. My idea is that simply adding an extra field into the login page. The extra field will require user to enter personal identification code (4 to ...
user avatar
  • 71
7 votes
4 answers
46k views

Redirect to referring page after logging in

I am not using any custom login plugins or any bespoke code. A few of my pages have got this bit of code in them at the very beginning. <?php if(!is_user_logged_in()) wp_redirect('/...
user avatar
7 votes
5 answers
10k views

WordPress auto login after registration not working

I looked up a bunch of threads trying to figure out how to automatically log a user in after registration, and came up with this. function automatically_log_me_in( $user_id ) { $user = ...
user avatar
  • 121
11 votes
5 answers
75k views

Redirect loop when trying to login to /wp-admin/ [duplicate]

Stuck in an infinite loop when trying to log in to my wordpress site. I type in the URL/wp-admin and then it loops me back to the regular website, not the admin login page. I have tried with http ...
user avatar
  • 111
5 votes
1 answer
3k views

How to use current_user_can()?

Because it's not working for me. This code checks if a user has just registered. I want to redirect him to a custom page if so. Otherwise, redirect him to the homepage or admin page. function ...
user avatar
  • 1,355
5 votes
2 answers
12k views

Limiting sessions to one IP at a time

On a site with premium user account subscriptions, I'd like to be able to limit logins to one computer at a time. The most straightforward way to accomplish this would be to limit by IP, but I haven't ...
user avatar
  • 527
2 votes
2 answers
2k views

Give visitor access to password protected page/post via external script

Overview: On my site I want to do a customer area. There is a form where the visitor enters a name (e.g. "event_xyz") and a password. Only some well informed circles (participants of the event xyz who ...
user avatar
  • 533
6 votes
3 answers
9k views

How do I change the language of only the login page?

My wordpress blog is set up as de_DE. This means that my login page is also displayed in de_DE. I would like to only have the login page in en_US. So, How would I programmatically change a single ...
user avatar
3 votes
1 answer
2k views

Is it possible to use a forgot password url filter?

i recently found that a login url filter is available but i can't find a solution for the forgot password as well, for the login url i use this: function custom_login_url($login_url) { return ''....
user avatar
  • 1,989
2 votes
1 answer
11k views

How to create custom LOGIN and REGISTRATION forms?

I have developed a theme for Wordpress and I need to customize login and registrations form. At the moment, as usual, the login and the registration URL are: http://www.example.com/wp-login.php http:/...
user avatar
  • 165
1 vote
1 answer
2k views

Display sortable User meta column in admin panel user's page

I have defined login levels for users registered on my site as Level 1 and Level 2. I have added a column for same in admin panel users page (users.php), I'm trying to add sorting option but on click ...
user avatar
  • 1,067
1 vote
2 answers
2k views

How can I test the login for an expired session?

I'm developing a login plugin and need to test the login form that pops up after a session has expired. I would like to see the popup appear on my request. Any hack is fine. Ideally some little ...
user avatar
  • 161
0 votes
1 answer
155 views

add the user name to menu when user is logged in [closed]

i have this code but its not working it throws syntax error, unexpected '}' error function my_custom_menu_item($items, $args) { if(is_user_logged_in() && $args->theme_location == '...
user avatar
0 votes
1 answer
1k views

Add log in link to menu in Twenty Twelve

I can't find a way to add the log in link to the new theme of WordPress, Twenty Twelve. I did find a lot of answers on the older theme, where they suggest to add some code in the functions.php file. ...
user avatar
  • 203
-2 votes
2 answers
276 views

How can I make content disappear when a user logs in?

I am working in Wordpress, and I would like to make certain elements disappear once a user logs in. How can I do this? I have social icons on my page that I positioned to the center of my menu bar at ...
user avatar
10 votes
5 answers
21k views

Disallow user from editing their own profile information

I'm currently developing an intranet and I am using Justin Tadlock's Members plugin to control roles and capabilities. I have created a HR role to allow Human Resources staff to create and edit user ...
user avatar
  • 11.8k
12 votes
1 answer
13k views

How reduce wordpress login session timeout time?

I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any ...
user avatar
7 votes
4 answers
4k views

Replacing the Wordpress password validation

I have a custom application with thousands of users who already have a password stored. I would like to set up a self hosted wordpress site to accompany that application and to use the usernames and ...
user avatar
6 votes
1 answer
9k views

check first time login only

i want to display welcome message or redirect the user to my custom template when the user login for the first time only. After the user can visit the regular page of the site.
user avatar
  • 563
3 votes
2 answers
21k views

Auto login using Active Directory and Windows Authentication

I've been able to setup and use a couple different LDAP plugins (CoSign SSO, Simple LDAP Logon) to create new WordPress users based on the Active Directory users but it still requires them to manually ...
user avatar
  • 133
11 votes
1 answer
10k views

How to Change the Default Home Page for the WordPress Dashboard?

Is it possible to change the Default "Home" admin page when logging into the WordPress Dashboard? I thought about a couple of possibilities... Substitute the content on the Dashboard home page with ...
user avatar
1 vote
1 answer
23k views

Send reset password link to user from custom lost password form

I've been struggling searching through a bunch of tutorials with no luck. I have a custom login page and am just replacing the login form with the forgot password form on click. My issue is how to get ...
user avatar
10 votes
1 answer
6k views

Removing username from the 'wordpress_logged_in' cookie

I am working with a client with some strict security measures. After undergoing security review, we were notified that the user name stored in the logged in cookie, e.g. wordpress_logged_in[username]|...
user avatar
  • 2,929