I am using Google apps login plugin. I would like to keep this only as a login mechanism and remove the built in: username/password that appears below it.

How can I disable the wordpress built in authentication mechanism? by disable i mean disallow any manual forging of its login url request too.

  • This is actually a two part question. One you need to customize the WP login screen to remove the WP login form. There are plugins that will do it. The second part is to remove the WP native auth. It is something simple like remove_filter('authenticate', 'wp_authenticate_username_password');
    – user42826
    Mar 14, 2015 at 0:20
  • To remove the login form is simple too, but the tricky part is that other authentication plugins, probably the GA login, insert their links into the WP login form. We used one of the WP login hooks, then added javascript to hid the loginform.
    – user42826
    Mar 16, 2015 at 2:38
  • @user42826 thanks, i think i will edit wplogin.php for this case
    – ccot
    Mar 16, 2015 at 2:52
  • Dont modify wp-login.php. Every time you upgrade it will be written over. This is why WP has hooks... the changes will persist even after upgrades.
    – user42826
    Mar 16, 2015 at 3:59
  • Did you see the Google Auth example from the plugin creators? They added javascript to hide the username and password parts of the form. wp-glogin.com/wp-login.php
    – user42826
    Mar 16, 2015 at 4:04

1 Answer 1


To remove WP native username/password authentication use the code below. It can be added to the theme (functions.php), to a plugin, or mu-plugin. Just make sure you have another authentication module working before you disable WP native auth.

remove_filter('authenticate', 'wp_authenticate_username_password', 20, 3);

  • I tried it in functions.php, it doesn't seem to work. I am using wordpress 4.1
    – ccot
    Mar 15, 2015 at 15:24
  • 2
    It works for me. I added it in a plugin and mu-plugins as a test. Note that this does not change the login form. It removes the WP native authentication. If you create a user with a password try logging in with and without the remove_filter above.
    – user42826
    Mar 15, 2015 at 19:12
  • ok didn't know that, thanks for the clarification. Worked like a charm
    – ccot
    Mar 16, 2015 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.