WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed the wordpress social login and I want users to login only using social website IDs. Now as a second step I do not want the username and password fields for users in the login page as that is redundant.

One way is to hack the php files that display the login page... but I want a more modular structure. I plan to make the username and password fields invisible by adding custom css (using a custom css plugin) and adding the following:

    visibility:hidden !important;
    visibility:hidden !important;

However the fields still remain visible. Any solutions please?

share|improve this question
Do you realize how indescribably easy it is to get around a CSS or Javascript solution? – s_ha_dum Nov 8 '13 at 15:10
up vote 2 down vote accepted

If you are ready to do this with css, you can do it in the following clean way.

Add the following code in the current theme's functions.php file

add_action( 'login_head', 'wpse_121687_hide_login' );
function wpse_121687_hide_login() {
    $style = '';
    $style .= '<style type="text/css">';
    $style .= '.login form{ display: none }';
    $style .= '.login #nav a, .login #backtoblog a { display: none }';
    $style .= '</style>';

    echo $style; 

or use the below way to enqueue the css file to the login page then use the css.

Add the below code in your current theme's functions.php file

add_action( 'login_enqueue_scripts', 'wpse_121687_hide_login' );
function wpse_121687_hide_login() {
    wp_register_style( 'hide-login', plugins_url( 'path to /css/hide-login.css' ) );
    wp_enqueue_style( 'hide-login' );

And then add the css in the hide-login.css file

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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