logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

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

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: http://wpmu.org/force-user-registrations-to-your-own-buddypress-registration-page/ ), but that method didn't work for in-page login forms, like this: http://screencast.com/t/nwR0lwzNnl

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.

http://wordpress.org/extend/plugins/login-lock/ 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.

Clifford P | 08/11/12 at 1:34pm Edit


(5) Possible Answers Submitted...

Note: Clifford P felt their question was unanswered, so we granted them a refund.

Note: Clifford P requested a refund. They offered this explanation:

"no valid answer. all responses seemed to not have read or understood the question."

If no one challenges a refund request, then they are automatically granted and proccessed after 48 hours. Admins of this site only review refund requests if someone challenges the request. If you are curious about how we handled previous refund requests, you may read over all refund requests and their challenges.

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    08/11/12
    1:44pm
    Yoyo Sunaryo says:

    hi, Clifford P.
    have you look this plugin :
    http://wordpress.org/extend/plugins/rpx/

    • 08/11/12 1:52pm

      Clifford P says:

      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.

  • avatar
    Last edited:
    08/11/12
    2:05pm
    Asad Iqbal says:

    Hi,
    Please check the following link:

    http://stackoverflow.com/questions/1976781/redirecting-wordpresss-login-register-page-to-a-custom-login-registration-page

    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.

    • 08/11/12 2:25pm

      Clifford P says:

      Your link didn't provide a solution different from the wpmu.org 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.

    • 08/11/12 2:35pm

      Asad Iqbal says:

      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.

    • 08/11/12 3:05pm

      Clifford P says:

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

    • 08/11/12 5:27pm

      Asad Iqbal says:

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

    • 08/11/12 9:15pm

      Clifford P says:

      http://codex.wordpress.org/Function_Reference/wp_login_form

  • avatar
    Last edited:
    08/11/12
    2:19pm
    Jatin Soni says:

    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.

    Previous versions of this answer: 08/11/12 at 2:19pm

    • 08/11/12 2:23pm

      Clifford P says:

      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?

  • avatar
    Last edited:
    08/11/12
    3:13pm
    Arnav Joy says:

    you can use this plugin

    http://wordpress.org/extend/plugins/theme-my-login/

    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.

    • 08/11/12 3:42pm

      Clifford P says:

      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.

  • avatar
    Last edited:
    08/11/12
    10:55pm
    Manoj Raj says:

    Try the following



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

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

    • 08/14/12 10:50am

      Clifford P says:

      Sorry, never saw your update (never got the notification email). I think WPQuestions.com 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.

This question has expired.





Current status of this question: Refunded



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.