Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Hiding the WordPress login and password fields from login page

I had the same question and the same issue.

But with some changes to your code, you can hide the WordPress login and password fields, and still keep the social logon button.

Just add the code below to your theme’s functions.php file

/**
* This hides the login and password fields so only the social login button is visible
*/    

add_action( 'login_head', 'wpse_121687_hide_login' );
function wpse_121687_hide_login() {
    $style="";
    $style .= '<style type="text/css">';
    $style .= '.login label{ display: none }';
    $style .= '.login .button.wp-hide-pw .dashicons{ display: none }';
    $style .= '.login form .input{ display: none }';
    $style .= '.login form .forgetmenot{ display: none }';
    $style .= '.login #nav a, .login #backtoblog a { display: none }';
    $style .= '</style>';

    echo $style; 
}

There is probably some more tweaking that could be done, like removing the large LOGIN button, but I’m still working on it.

Any advice on improvement from an expert would be appreciated!

Related Posts:

  1. How do I validate extra pin field on my WordPress login form page?
  2. Can someone explain what wp_session_tokens are, and what are they used for?
  3. Init action hook running late after PayPal’s return url?
  4. How to check WordPress website username and password is correct
  5. Log in from one wordpress website to another wordpress website
  6. Problems after wp_set_password() containing an apostrophe
  7. Two-step login process – Is it possible?
  8. How do I approach removing menu items on the fly based on settings in my plugin?
  9. Is there any way to check for user login and send him to login?
  10. Why is my javascript not invoked in my hooks except wp_head?
  11. Proper way to pass credentials in a custom login form to avoid “headers already sent”
  12. External Authentication, session_tokens not destroyed on logout
  13. Verify if user is wordpress logged in from another app since wordpress 4.0
  14. How to customize login process
  15. wp_insert_user() function password never match
  16. Does wp_login only trigger before an user signs in into the admin panel?
  17. Logout users upon login, based on caps/role?
  18. Is it possible to make sure that only my plugins output is shown to the enduser?
  19. Custom login doesn’t work properly
  20. Password field is empty when using wp_signon();
  21. Plugin Development for registered users
  22. Enqueue script globally
  23. WP Multisite login not working on one subsite. Possibly cookies/ history issue?
  24. Can we intercept user_login and user_pass from a wp_login_form?
  25. How to redirect home page to another page after login for all user?
  26. How to share user data across multiple WordPress websites?
  27. Allowing duplicating users with same user_login and user_email
  28. How to Login a User inside a Plugin and Redirect to page?
  29. Using custom IDP with WP
  30. how to add security questions on wp-registration page and validate it
  31. redirect_to how to make it simply work with get parameter or similar?
  32. How to create session for user which is not an admin user
  33. Redirect default login page to a custom page [duplicate]
  34. Multiple Users Logged In Causing Incorrect Account Returned
  35. Get user logged in status from within a plugin. $current_user not defined
  36. Need edit profile link in the menu for logged in users
  37. Create a Custom Login System in WordPress [closed]
  38. how can I insert a link on login page
  39. user can login from single account detail from multiple locations(computer) at the same time [closed]
  40. how to works woocommerce cart hash
  41. How to access index file in Block Themes?
  42. Custom Endpoint – Does it possible to use PUT method with WP API Rest?
  43. How Place a Custom Form Fields in a specific location on the User Profile Page?
  44. How to determine primary editor for a page/post
  45. How does one update complex options?
  46. wp_new_user_notifications to notify user and admin about new user registration
  47. Is it possible to use the MySQL’s ORDER BY FIELD() clause as part of the pre_get_posts hook?
  48. Access to the template file of a plug-in
  49. List all user post API endpoint
  50. How to highlight a page in the page list (Admin Menu)?
  51. Can’t remove action hook on plugin class
  52. Using wp_mail to send email?
  53. Which wp plugin can use Create, Edit and Delete Email address from WordPress Dashboard
  54. Using WordPress with WP Statistics for QR code usage survey
  55. Bootstrap within shortcode
  56. Integrating a Gutenberg custom block within a larger plugin
  57. Rewrite not working since upgrade to 5.9
  58. How to do admin ajax request in a plugin for rest api
  59. Why won’t this submenu page show? – My First WordPress Plugin
  60. WordPress plugin development theme issue
  61. How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
  62. When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
  63. New jquery and bootstrap breaks plugin
  64. How to show comments from different Plugins to same post type?
  65. How to create a custom wordpress plugin
  66. Disable redirect to homepage after successful Login, Stay on Current Page
  67. Action / Hook when a new plugin is added
  68. wordpress full site editing problem when extending core blocks
  69. Proper way to do a page view count on a page?
  70. Catching a GET parameter from the URL and save it in the user meta when a user registers
  71. How to check if `comment_meta` exists before inserting the comment?
  72. How to get the `comment_post_ID`?
  73. apply_filters() and call_user_func() to define and call a function outside a class
  74. WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
  75. Showing results from json-string in WordPress search results page
  76. Can someone explain what’s the use of parse request function in WordPress?
  77. Attaching Image-file to userId
  78. Add parameters to 3rd party callback function
  79. Pass custom props to
  80. How to show only the last two categories in a menu?
  81. wp.media gallery collection sometimes undefined
  82. How to save page URL as a favorite
  83. Getting Post ID at “stylesheet” and “template” hooks
  84. Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
  85. Pass Values in URL on WooCommerce Product Page
  86. Get API auth_token token to renew weekly
  87. Ajax action has 200 status but response of No response data available for this request
  88. How to remove dynamic-css
  89. Custom post type change permalink query
  90. Woocommerce place order update shipping price
  91. escape html in jQuery for WordPress
  92. How to display specific data from a custom table to logged in users with a custom role
  93. Upload product image from frontside for administrator only
  94. Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
  95. woocommerce store login not working at first time
  96. wp_schedule_event not executing function call, even with add_action
  97. Progress bar in plugin within admin
  98. add_filter postbox_classes multiple post types
  99. force logged in user to stay in the dashboard
  100. Generating a password-protected front-end page via a plugin
Categories plugin-development Tags login, plugin-development, wp-login-form
Can I alter the main loop to ‘orderby’ a custom callback?
Show subcategories broken when WP/WC updates

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress