Skip to content
    logo
  • About Us
  • Services
    • Native Mobile Apps
    • Hybrid App Development
    • Web Development
    • Website Design
    • UI/UX Design
    • Outsourcing
    • Quality Assurance
    • Salesforce Consulting
  • Technologies
    • Mobile
      • Android App Development
      • iOS App Development
      • Flutter
      • React Native
    • Node Js
    • React-js
    • WordPress
    • Laravel
  • Portfolio
  • Blog
  • Career
  • Contact Us
  • zluck instagram zluck instagram zluck linkedin zluck linkedin zluck twitter zluck twitter zluck skype zluck skype zluck github zluck github
zluck instagram zluck instagram zluck linkedin zluck linkedin zluck twitter zluck twitter zluck skype zluck skype zluck github zluck github
Web Development

How to Create a Custom WordPress Login URL

November 8, 2022 — 2 min read

Divyesh kakrecha

Divyesh Kakrecha

Sr. WordPress Developer
Blog detail banner image

Adding an extra layer of security is always beneficial and would be useful in the long run. The same applies to our WordPress websites also. We already have a login username and password that acts as the first line of defense against outsiders. The login credentials prevent them from gaining access to our website’s foundation and doing dreadful damage. But it is only safe and effective up to a certain degree. The basic login URL for a WordPress website is yourwebsitedomain/wp-admin. and yourwebsitedomain/wp-login.php.

What is the need to change the WordPress login URL, you are wondering? We will take a look at why you should have a custom WordPress login URL. One that is hard to guess and more secure than the default ones.

Why You Should Have a Unique WordPress Login URL

If you still continue to use the basic WordPress Login URL like wp-admin.php or wp-login.php you already have a disadvantage. The outsider or the perpetrator or commonly called a Hacker or an Attacker may be at the gate of our WordPress website. The only thing left to do now is to pick the lock, which is our WordPress login username and password. Now you might have a strong password and a unique username, but what about the other users? This is the loophole that the attacker will leverage. Most users would use their name and an easy-to-remember password to log in. Most often users will use a sequence of numbers or easy words as their login password.

Eg: 12345, admin, admin125, and so on.

The attacker can unleash the trial and error method, commonly known as Brute Force Attack to gain access, pick the lock and reach the dashboard. The attacker will try to log in with a number of usernames and passwords combination. A software or script does the rest and the only thing the attacker needs to do is to wait. Because WordPress powers a majority of websites around the around, finding the website login address to attack is not that hard. As all WordPress sites use the same login address by default. If any website user still uses the standard login username – admin and a weak password, now might be a good time to change it.

Now, now, no need to panic. You can stop all the dreadful thoughts of losing your website and all the content. The only thing you need to do is to change the WordPress login URL to a custom and unique one. Yes, it is possible to change the login address. There are two ways to do it-

  • Change the login URL with the help of a WordPress Plugin
  • Create a custom WordPress login URL manually

How to Create a Custom WordPress Login URL With a Plugin

In the WordPress repository, there are multiple plugins that will allow us to change the login address to a custom one. Some of the common ones are Change wp-admin login and WPS Hide Login. For now, we will be focusing on WPS Hide Login. With over 1 million downloads, it is a light plugin that does the job perfectly.

With the use of this plugin, one can easily change the login URL, without the need to code anything. Before starting, it is always a good idea to back up the entire WordPress site, just in case. Once again, all you need to back up a WordPress site is a plugin. We can also back up the website manually. After a successful backup, let’s move on to changing the login URL.

Go to the WordPress plugin repository, download, and activate the WPS Hide Login Plugin.

WPS Hide Login Pluing.

The plugin after activation can be found in the settings section. Access the plugin from there.

Access the plugin from there.

After accessing the plugin, scroll down and locate the login URL section. Enter a new URL for your WordPress site and that is it.

Enter a new URL for your WordPress site and that is it.

Let’s try out our new WordPress login page URL.

new WordPress login page URL.

Under the redirection URL option, there is a note that tells us that the two URLs- mainly wp-login.php and wp-admin, cannot be accessed by non-connected people. Access to those two URLs can only be made if you are already logged in.

Under-the-redirection-URL-option

If anyone tries to access the wp-admin or wp-login.php it would redirect them to the 404 error page.

How to Create a Custom WordPress Login URL With a Plugin-6

Now, there are a number of plugins that offer the same functionality of changing the login URL as a part of their features. To mention a few are- All In One WP Security & Firewall, Shield Security, and Defender Security. If you are using any of these plugins, there is no need to switch to a different plugin. The functionality to change the URL is already there.

Create a Custom WordPress Login URL Manually

Now if you don’t want to use a plugin to create a custom URL, there is always a manual method. Only four steps are involved to create a custom login URL. Creating a custom login URL manually does have its drawbacks which we will discuss. As always make a backup of the WordPress website before starting.

Firstly, we need to download the wp-login.php file and keep a copy of it. We can do this by logging in to the administrative area. Now access the file manager to download the file. The file would be located inside the public_html folder.

Create a Custom WordPress Login URL Manually-1

Now, open the downloaded file with a code editor. Search for wp_login. Replace all wp_login.php instances with the new login URL. In our case, it would be wp-secret.1login.php, and save the file with a new name.

Create a Custom WordPress Login URL Manually-2

Now go back to the file manager, and upload the new file.

Create a Custom WordPress Login URL Manually-3

Now, we need to add the below code snippet to redirect the default login URL to the homepage and register wp-secret.1login.php as the new login endpoint.  We can add this code in the theme’s functions.php file (child theme is recommended), or if using any code snippets plugin, then code can be added with the help of the plugin.

function wpcontentco_redirect_default_login_url() {
    global $pagenow;
    if ( isset( $pagenow ) && $pagenow === 'wp-login.php' && ! is_user_logged_in() ) {
   	 wp_safe_redirect( site_url( '/' ) );
   	 exit;
    }
}
add_action( 'init', 'wpcontentco_redirect_default_login_url' );

function wpcontentco_login_url( $url ) {
    $url = str_replace( 'wp-login.php', 'wp-secret.1login.php', $url );
    return $url;
}
add_filter( 'login_url', 'wpcontentco_login_url', 100 );
add_filter( 'lostpassword_url', 'wpcontentco_login_url', 100 );
add_filter( 'logout_url', 'wpcontentco_login_url', 100 );

 

The last thing to do is to test the new login file. Put the login address in the browser and see if it works.

Put the login address in the browser and see if it works.

After any major update to WordPress core, if there are any issues, it is recommended to repeat the whole process again, and create a new login.php file and add the code snippet.

How To Revert Back To The Original WordPress Login URL

In very rare cases, the new URL address may not work properly, leaving us stranded with no access to our dashboard. If such a scenario ever happens, don’t panic, we can fix the issue.

There are three ways to restore the original WordPress login URL depending on how you changed the URL in the first place.

  • The first method is either to restore the WordPress backup that we created.
  • The second method would be to remove the new login.php file and replace it with the old one and also to remove all the added code.
  • The third method is to delete the plugin folder from an FTP file manager ( for those who used the plugin to change the URL).

If you have used a plugin, just follow the below-mentioned steps:

Access the FTP file manager and connect to your website. Once connected to the website, the plugin folder can be found inside the wp-content/plugins folder.

How To Revert Back To The Original WordPress Login URL-1

Delete the folder. After deletion, the login URL will be replaced by the default WordPress URL.

For those who followed the manual method:

Delete the new login file and replace it with the old one. In our case, it would be to delete wp-secret.1login.php and replace it with wp-login.php. This is why we recommended taking a backup of the original login file. Also, make sure to remove the added code snippet.

How To Revert Back To The Original WordPress Login URL-2

Conclusion:

Zluck Solutions is the perfect choice for WordPress website development and performance improvement. We are experts at boosting WordPress website speed and performance, utilizing the latest technologies and techniques. Our team can help you get the most out of your website, with improved page loading times, enhanced security, and a better overall user experience.

Contact us today and we’ll give you the best WordPress services you can ask for.

You Might Also Like:

blog img
user img
Hardik Prajapati

February 14, 2023

Web Development

How Much Does It Cost to Outsource Website Development?

When it comes to developing a website, there are a few options to consider. One of the most popular options is to outsource website development to a third-party company. This can be an attractive option for businesses of all sizes, as it allows them to get a high-quality website without having to invest in a […]

blog img
user img
Yash Dudhat

January 31, 2023

Web Development

Best websites to help in content marketing journey

Here are some popular websites that can help you with your content marketing journey. These websites offer a wealth of information, resources, and tools to help you with your content marketing efforts. It is always a good idea to keep learning and staying up to date with the latest developments in the field.

blog img
user img
Hardik Prajapati

January 25, 2023

Web Development

Javascript OOP concepts

In JavaScript, object-oriented programming (OOP) is a programming paradigm that uses objects and their interactions to design applications and computer programs. The main concepts of OOP in JavaScript are

View All
zluck

Zluck is an international IT firm that specializes in all types of web, mobile, and digital media solutions.

India

India

+91 97262 50544

zluck usa branch

USA

+1 (760) 904-3076

zluck instagram zluck instagram zluck linkedin zluck linkedin zluck twitter zluck twitter zluck skype zluck skype zluck mail zluck mail

Services

  • Native Mobile Apps
  • Hybrid App Development
  • Web Development
  • Website Design
  • UI/UX Design
  • Outsourcing
  • Quality Assurance
  • Salesforce Consulting

Technologies

  • Android App Development
  • iOS App Development
  • Flutter
  • React Native
  • Node Js
  • React-js
  • WordPress
  • Laravel

About

  • Zluck Solutions
  • Our Great Works!
  • Our Special Insights
  • Explore Careers

Services

  • Native Mobile Apps
  • Hybrid App Development
  • Web Development
  • Website Design
  • UI/UX Design
  • Outsourcing
  • Quality Assurance
  • Salesforce Consulting

Technologies

  • Android App Development
  • iOS App Development
  • Flutter
  • React Native
  • Node Js
  • React-js
  • WordPress
  • Laravel

About

  • Zluck Solutions
  • Our Great Works!
  • Our Special Insights
  • Explore Careers

Get a Free Quote!

Make your statement on the web!

Get a Free Quote

© Zluck Solutions. All rights reserved

  • Contact Us
  • Privacy Policy