Programming is my Passion
Provide Training is my skill
Quality and Commitment is my Life's Goal
Programming is my Passion
Provide Training is my skill
Quality and Commitment is my Life's Goal
Ankit Sudhera Portfolio Website
There are many methods, but I will mention few as below:
First Method (Redirect using site cookie, function and htaccess):
define('WP_ADMIN_DIR', 'secret-folder');
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);
add_filter('site_url', 'wpadmin_filter', 10, 3);
function wpadmin_filter( $url, $path, $orig_scheme ) {
$old = array( "/(wp-admin)/");
$admin_dir = WP_ADMIN_DIR;
$new = array($admin_dir);
return preg_replace( $old, $new, $url, 1);
}RewriteRule ^secret-folder/(.*) wp-admin/$1?%{QUERY_STRING} [L]
Second Method (Rename wp-login with new file like new-secret-login-file):
Note: If any HTTP/HTTPS requests to the /wp-login.php, or /wp-admin, directories will lead visitors to a 404 not-found page.
Third Method (Protect wp-login.php With a Cookie and .htaccess):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !^.*wp\-connect=2917998723.*$ [NC]
RewriteRule wp-login.php - [F]
</IfModule><?php
setcookie("wp-connect", 2917998723);
header("Location: wp-login.php");
Note: Please remember, Admins need to first go to domain/wp-connect.php to access wp-login.php