Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

turn off wp-login.php -- force login with 3rd party login WordPress


There are plenty of plugins for integrating Facebook, Twitter, G+, Mozilla Persona, and other login systems.

I want a code snippet / plugin to completely turn off the default WordPress login so that the only login option is a 3rd party login.

I tried a simple code snippet to find 'wp-login.php' in the URL of the current page ( similar to this: [[LINK href=""]][[/LINK]] ), but that method didn't work for in-page login forms, like this: [[LINK href=""]][[/LINK]]

I looked into the WP hooks and didn't see one to tie into for the login form.

Can anyone here come up with a solution? Ideally, it'd be compatible with MultiSite and BuddyPress and anywhere/everywhere an in-page login form would ever show up.

[[LINK href=""]][[/LINK]] and other plugins have a lockdown mechanism, but I didn't find exactly what I was looking for. But if you know of an already existing plugin, please provide that as the answer. However, I found a lot of similar plugins that haven't been updated in a very long time.

FYI: I will probably put it on wp plugin directory if you don't. And I'll definitely blog about the solution once I get it.

Answers (5)


Yoyo Sunaryo answers:

hi, Clifford P.
have you look this plugin :

Clifford P comments:

That is a social login plugin; one of many. I am not looking for one of those. I am looking for a way to completely disable WP's login system while having a plugin like the Janrain one you linked to still working. This way, if WP login is disabled but social login is enabled, they CANNOT use the wp login.


Asad Iqbal answers:

Please check the following link:

I've checked and it works for me. I think first you lock down the default login using the lock down plugin and then use the code. Let me know what happens to your end.

Clifford P comments:

Your link didn't provide a solution different from the link's code that I provided.
Maybe login_head is a good hook to use, maybe not, but I didn't see any code different from what I already provided.

Asad Iqbal comments:

Not sure but I think that you want to turn off wp-login.php which can be done use that plugin and then if you want to register from different login then you just add that function to functions.php. If you've another url ready to do the registration process then it seems this is a possible solution I guess. If not then may be I misunderstand the problem. And you are right, both link have some different code but have same functionality.

Clifford P comments:

That method doesn't work for in-page login forms. Or am I missing something? If I am, please copy/paste here. Thank you.

Asad Iqbal comments:

Paste your form code here or generally how you see the form?

Clifford P comments:

[[LINK href=""]][[/LINK]]


Jatin Soni answers:

Luckily I am not working on the same task but before I help you in any way just want to know and confirm either you are going to put log in url statically or dynamically.

I have ready code which will completely block wp-admin, wp-login access and will only allow to admin and for login and registration I am redirecting on my appropriate page url.

So if you are okay with that I can provide you full functional code and you may need to change only login and register url as per yours.

Clifford P comments:

Any workaround to accomplish the goal, although I would prefer typing in wp-admin still knows to take me to the login form. My ideal solution would be just like my screenshot -- no real changes to anything other than the wp-login form totally not loading at all. As such, if the 3rd party login doesn't work, everyone would be locked out (even admins) until I go into FTP and disable this plugin or comment out from functions.php. Make sense?


Arnav Joy answers:

you can use this plugin

this plugin show login form to the front end by creating a login page or you can use short code for it , just disable that page and you will not see any login page then you can use any other social plugin for login.

Clifford P comments:

logged out /wp-admin redirects to /login but /wp-login.php when logged out doesn't redirect.
Also, when changing the plugin's /login page from Published to Draft, going to /wp-admin when logged out results in the theme's 404 error.

So, while a cool plugin, I don't think this is a solution for my question. Please let me know if I got something wrong.


Manoj Raj answers:

Try the following

function remove_wplogin_page() {
if (strpos(strtolower($_SERVER['REQUEST_URI']), '/wp-login.php') !== false && !current_user_can('administrator')) {

add_action('init', 'remove_wplogin_page', 0);

Clifford P comments:

Sorry, never saw your update (never got the notification email). I think has been down intermittently.

Your code does exactly the same thing I already provided in my initial question. It does not REMOVE the login username and password input boxes, and it also does not work on in-page login forms.