Another article related on WordPress-based Content Management System which is focusing on how to hide the login page provided by WordPress manually. In order to achieve it, below are the steps which can be followed in order to access the login page of WordPress-based website without having to use the default login page in the form of URL address as shown in the pattern for an example as follows :
http://www.site-name.com/wp-admin
So, in order to access the login page without having to type the default login page in the form of an URL address shown above, these steps can be done as an alternatives :
1. Access the WordPress-based website’s source.
2. Edit the file named wp-login.php which is normally exist in the root folder of the WordPress-based website into a file with the name of anykind of name chosen so that in order to access the login page of WordPress-based website will have the form of URL address as shown in the pattern as follow :
http://www.site-name.com/mysuperadminpage.php
In order to access the URL address as shown above, change the wp-login.php file name into mysuperadminpage.php.
3. After editing the file name, the content of the new login page file must also be updated. Just replace the content of the wp-login.php which has already renamed into mysuperadminpage.php where every single text contain wp-login.php must be changed or must be replaced into mysuperadminpage.php. To be able to change the content, using an editor in UNIX such as ViM, just type the following :
:%s/wp-login.php/mysuperadminpage.php
The above command is a command which is executed to replace all of the occurrences of text contain ‘wp-login.php’ into ‘mysuperadminpage.php’. In the context of another text editor, it is basically similar with ‘Find and Replace’ feature.
- Change the following content of file named general-templates.php which is located in a folder named ‘wp-includes’. Update the content by changing the following line which exist inside the file :
function wp_login_url($redirect = '', $force_reauth = false) { $login_url = site_url('wp-login.php', 'login'); ...
into :
function wp_login_url($redirect = '', $force_reauth = false) { //$login_url = site_url('wp-login.php', 'login'); $login_url = site_url('', 'login');
Just comment the old line and add it with :
$login_url = site_url('', 'login');
Or just replace it so that the following snippet code will be shown as follows :
function wp_login_url($redirect = '', $force_reauth = false) { $login_url = site_url('', 'login'); ...
It is done by removing the ‘wp-login.php’ in the above line into ”.
Hi,
Your article is the best from the list of “How to hide manually WordPress login” but unfortunately suffers from the same issue, as all others including plugins based techniques, that is you cannot log out.
I’ve tried further modifying “wp-login.php” after it is renamed, but it is out of my knowledge.
Can you or anybody help in this? I can see a lot of people struggling with this.
Thanks
Daniel