Remove “Remember Me” from login form

I have a form that is on the front end of my site. I’m trying to remove the “Remember me” checkbox but can’t get this to work. Here is my form code.

<?php

$args = array(
‘echo’ => true,
‘remember’ => true,
‘redirect’ => ( is_ssl() ? ‘https://’ : ‘http://’ ) . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’],
‘form_id’ => ‘loginform’,
‘id_username’ => ‘user_login’,
‘id_password’ => ‘user_pass’,
‘id_remember’ => ‘rememberme’,
‘id_submit’ => ‘wp-submit’,
‘label_username’ => __( ‘Username’ ),
‘label_password’ => __( ‘Password’ ),
‘label_remember’ => __( ‘Remember Me’ ),
‘label_log_in’ => __( ‘Log In’ ),
‘value_username’ => ”,
‘value_remember’ => false
);

wp_login_form( $args );
?>

I have tried this code, but I think this would be for the wp-admin form (and it doesn’t work on my form.

add_action(‘login_head’, ‘do_not_remember_me’);
function do_not_remember_me()
{
echo ‘<style type=”text/css”>.forgetmenot { display:none; }</style>’;
}

Any ideas on how to do this properly?

Read more here:: Remove “Remember Me” from login form

Leave a Reply

Your email address will not be published. Required fields are marked *