Table of Contents
Hi Hello, What I am going to do in this article I will see in detail about PHP 7 Script to Remove Remember me Option From WordPress Login Form in Browser. This article is a favorite of everyone and many people are suffering without knowing what the reason is. This article will be very useful for them.

PHP 7 Script to Remove Remember me Option From WordPress Login Form in Browser
<?php
/*
Plugin Name: Remember Me Not
Version: 1.1
Plugin URI: https://github.com/shrkey/remembermenot
Description: Completely removes the Remember Me functionality from WordPress
Author: Shrkey
Author URI: http://shrkey.com
Text_domain: shrkey
Copyright 2013 (email: team@shrkey.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
$root_dir = __DIR__;
// Include the plugin functions
require_once( $root_dir . '/includes/functions.php' );
if ( remembermenot_on_login_page() ) {
require_once( $root_dir . '/classes/public.remembermenot.php' );
}
<?php
// We initially need to make sure that this function exists, and if not then include the file that has it.
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
}
if ( ! function_exists( 'remembermenot_on_login_page' ) ) {
/**
* Check whether we are on the login page.
*
* @return bool
*/
function remembermenot_on_login_page() {
return isset( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'wp-login.php' ) );
}
}
<?php
if ( ! class_exists( 'remembermenotpublic' ) ):
/**
* Class remembermenotpublic
*/
class remembermenotpublic {
/**
* remembermenotpublic constructor.
*/
public function __construct() {
// Reset any attempt to set the remember option
add_action( 'login_head', array( $this, 'reset_remember_option' ), 99 );
// Add the hook into the login_form
add_action( 'login_form', array( $this, 'start_login_form_cache' ), 99 );
}
/**
* Reset remember option.
*/
public function reset_remember_option() {
unset( $_POST['rememberme'] );
}
/**
* Start login form cache.
*/
public function start_login_form_cache() {
ob_start( array( $this, 'process_login_form_cache' ) );
}
/**
* Process login form cache.
*
* @param string $content
*
* @return string
*/
public function process_login_form_cache( $content ) {
return preg_replace( '/<p class="forgetmenot">(.*)</p>/', '', $content );
}
}
endif;
new remembermenotpublic;
Final Words
By knowing clearly about PHP 7 Script to Remove Remember me Option From WordPress Login Form in Browser through this article. If you have any doubts please leave a comment via the comment box. Thank You.