WordPress is one of the most persuasive Content Management Systems. However, WordPress is frequently attacked by hackers.
In this Post, I’ll show you how to How To Change The WordPress Admin login URL Without Plugin.
In general, anyone may access the default login page. Simply include “wp-admin” or “wp-login.php” in the URL. Typically, attackers employ a variety of tactics to target your website. A brute force attack is one of their favorite things to do. During the procedure, hackers attempt to get access to your site by guessing the login password. As a result, in order to protect your site from hackers, you must modify the login URL.
Change The WordPress Admin login URL Wit a Plugin.
The most frequent and likely simplest option to modify your WordPress login URL page is to utilize a free plugin like WPS Hide Login, which has over One Million active users.
Change The WordPress Admin login URL Without Plugin.
Step 1: Take a backup of wp-login.php
Access your website core folder, then search for the wp-login.php file and download it to your computer.
Step 2: Change the Login URL in wp-login.php
Once you have a backup of wp-login.php, search through the file for every instance of “wp-login” and replace it with a new login URL. For example, my URL in this Article is “wp-secret-signin”.
Step 3: Now rename the file wp-login.php
Rename the file name to the new URL that we used in the previous step , whether it be something simple like wp-secret-signin.php
Step 4: Logout and Lost Password Filter Hooks to be added to Functions.php
WordPress logs users out by default using the wp-login.php file.
This implies that even if you change the file you use to enter into your website, WordPress will still attempt to log you out using the wp-login.php file.
The log-out URL filter hook is the ideal solution to tackle this problem since it allows you to alter the URL that users are redirected to after logging out.
You may also use the lost-password url to check that the URL for the lost password on the WordPress login form is valid.
Simply copy and paste the code below into your theme’s functions.php file, making sure to replace wp-secret-signin with your login URL.
// Filter & Function to rename the WordPress logout URL
add_filter( 'logout_url', 'my_logout_page', 10, 2 );
function my_logout_page( $logout_url) {
return home_url( '/wp-secret-signin.php'); // The name of your new login file
}
// Filter & Function to rename Lost Password URL
add_filter( 'lostpassword_url', 'my_lost_password_page', 10, 2 );
function my_lost_password_page( $lostpassword_url ) {
return home_url( '/wp-secret-signin.php?action=lostpassword'); // The name of your new login file
}
Step 5: Test Your New Admin Login URL
If you did all of the above, you should now be able to log in at your new login URL. When you log out, you should be sent to your new login URL.