I have found a couple of plugins which lets me set another URL. For example example/login instead of /wp-admin. But as soon as you go to that adress you are back on /wp-admin. So it is only like a redirect.
How do I change it so that all the url's change too?
I have found a couple of plugins which lets me set another URL. For example example/login instead of /wp-admin. But as soon as you go to that adress you are back on /wp-admin. So it is only like a redirect.
How do I change it so that all the url's change too?
Generally speaking, you don't. The "wp-admin" is hardcoded in many places.
At WPMU DEV they suggest the following Apache configuration if you need to rename the admin/login pages for security/customization.
# BEGIN Hide login page
RewriteRule ^mylogin$ https://%{SERVER_NAME}/wp-login.php?key=123&redirect_to=https://%{SERVER_NAME}/wp-admin/index.php [L]
RewriteCond %{HTTP_REFERER} !^https://%{SERVER_NAME}/wp-admin
RewriteCond %{HTTP_REFERER} !^https://%{SERVER_NAME}/wp-login.php
RewriteCond %{HTTP_REFERER} !^https://%{SERVER_NAME}/login
RewriteCond %{QUERY_STRING} !^key=123
RewriteCond %{QUERY_STRING} !^action=logout
RewriteCond %{QUERY_STRING} !^action=lostpassword
RewriteCond %{REQUEST_METHOD} !POST
# END Hide login page
Change mylogin to a slug of your choice and 123 to another more secure passphrase.
Credits: https://premium.wpmudev/blog/hide-wordpress-login-page-2/
Steps:
Add constant to wp-config.php
define('WP_ADMIN_DIR', 'secret-folder');
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);
Add below filter to functions.php
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);
}
Add below line to .htaccess file
RewriteRule ^securelogin/(.*) wp-admin/$1?%{QUERY_STRING} [L]
Done…!!!
Now your admin URL will be like: http://www.example/securelogin/
Note: put "/"
after securelogin