Best Way To change your Default WordPress Login URL

If you have a blog on WordPress, sooner or later, you will come across a question about protecting your site from hacking. Even if you are currently reading this article and think that this will not happen to you, your site is not very popular, and even to whom it is generally necessary, then you are very mistaken. We are going to talk about WordPress Login URL changes that you can do to secure your website.

The fact is that it’s not necessarily the visitors to your site or your worst enemy who want to hack into a site. This is done by various bots that are created in order to post their links or spam comments on the site, without deleting them. Even if now you have everything well with the site, you can look at the logs in the hosting admin panel, if your provider gives such an opportunity.

In the article, we will review why it is important to change the WordPress login URL and the ways how to do that.

Why should you change the WordPress login URL

In order to enter the WordPress admin panel, as a rule, you add wp-admin to the website address. In that case, the link looks like the following: [ This is a sample WordPress Login URL]

Using this link, absolutely anyone can go to the page and admin panel and try to access your site. They can use the brute to collate the login and password. We can say that using the default WordPress login URL can be dangerous for your site security.

On the Internet, there is a lot of information about the redirect from the wp-admin page. And a lot of useful information that allows you to filter out curious visitors who do not yet know that the entrance to the admin panel is located at

When such user enters, WordPress redirects him to That’s how WordPress Login URL generally behave while you try to sign in. There, he can try to enter the correct password. The various bots use the same address to attack your site. As the result, it takes your site’s resources and overloads it.

How to avoid that? You will need to change the WordPress login page.

Additionally, when you allowed registering on the site, it means your visitors have access to the login page and then you need to monitor all those who can access the site.

One of the possible solutions is to close the registration for the users.

In that case, only you will have access to the login page. The bottom line of the method is to change WordPress login URL.

If you allow registration, then, of course, visitors will know this address, but the bots that are configured for standard pages will disappear immediately. If there is no registration, no one else will be able to access the page.

How to change the WordPress login URL?

Let us understand some of the best steps to change the WordPress Login URLs in this blog.

1. Changing the .htaccess file

First of all, you will need to get access to your website root folder via FTP. You will be able to find the login information in your hosting account control panel, or by contacting tech support. Use one of the FTP file managers to access the site. The most popular ones are FileZilla and Total Commander.

When you find the site, download it to your local drive and then open in any text editor. The simplest option is standard Notepad. Add the following code in the bottom of the file:

To make everything work, you need to replace several elements. They meet several times, so be careful.

  1. custom_admin_url — this is your new URL — the admission address to the admin site and just logging into the site. Create your own address. For example, control_panel something like that. Try to make it unique because the modern bots can collate the most popular addresses.
  2. com — your website address, without http://. Change to your own.
  3. your_secret_key — this should be replaced with the secret key you created. This should be a string of letters and numbers written in random order. For example, gjhehg57e3au83kwdhfh or something like that. Save it to a reliable place in case you may need to use or change it.

Now the login page will be available at, for example –

Note : This method only works on Apache servers and does not work for Nginx servers.

There is another way to change the URL, and its bottom line is to change the file name. First, we completely block access to wp-login.php. To do this, add the following code to the .htaccess file:

Now in the website root folder, find the wp-login.php file and make its copy. You need to rename the copy, for example, mylog.php. Then we open a new mylog.php and change wp-login.php to mylog.php in it. Now, to enter the website login page, you will have to use

Perhaps, after the WordPress update, if the content inside changes, you will have to repeat the procedure. But until the code remains the same, everything will work.

Now when someone will try to go to the old addresses, they will be redirected to 404 error page. You can only log in using the new link.

2. Editing the wp-config.php file

In order to change the WordPress login URL, you will need a file that is responsible for displaying the form to access the panel. It is called wp-login.php. You will have to access the site via FTP and download the file to the local drive. When you copied it to the computer, rename it. Choose a convenient to use a name. Make it quite difficult and avoid too simple names. Let’s call it website_control.php (it’s not necessary to give the file this name, you are free to choose any).

Now, open the file using any code editor like Notepad ++ or VS Code. Replace the old file name (wp-login.php), with the new file name (in our case, it’s website_control.php).

In total, you must have 12 replacements. Then save and upload the file back to the hosting.

Now you can log in to the admin panel at But, the old pages — and — are still available. And this means that we need to block an access to the admin panels with old addresses.

3. Set up a redirect from wp-admin and wp-login

In order no one could access the old addresses to enter the control panel without a 404 error, you will just need to configure the redirect.

For this we need to open the functions.php file. Before you start, make a backup copy of functions.php

Open the WordPress admin panel using the new address, then go to Appearance — Editor — Theme functions. Scroll down to the bottom of the file. And in the end, insert the following code:

WordPress login edits

Redirect from wp-admin:

After that, the website will be redirected from to

Redirect from wp-login:

There will be the same redirect from to

Redirect while leaving the admin panel:

The latter code will clean all the junk code while the registered users leave the site.

4. Using WPS Hide Login plugin to hide your WordPress Login URL.

WordPress login

Go to the plugin directory in your WordPress dashboard and find the WPS Hide Login in the search field. After that, install and activate the plugin. Now, go to Settings — General, and in the bottom of the page, change the WordPress login URL into the one you need to.

It will help to prevent any unauthorized access to your wp-login.php file and wp-admin folder. Your website will be much more secure.

We reviewed the several ways how to change the WordPress login URL for your website. It will definitely help to make it more secure. What way is the most convenient for you?

cta 1 Best Way To change your Default WordPress Login URL

Final Thought

The above four methods are the prominent ways to change your WordPress Login URLs which will prevent you from being attacked by hackers. These methods are more secured and easy to implement.

Did you find a new way to change your WordPress Login URLs? Let us know your ways in the comment section below and we shall add those steps to our blog.

19 Replies to “Best Way To change your Default WordPress Login URL”

  1. Hello I am so glad I found your website, I really found you by mistake, while I was browsing on Aol for something else, Nonetheless I am here now
    and would just like to say many thanks for a marvelous
    post and a all round enjoyable blog (I also love the theme/design),
    I don’t have time to read it all at the moment but I have bookmarked it and also added in your RSS feeds, so when I have time
    I will be back to read a lot more, Please do keep up the fantastic work.

  2. hi!,I love your writing very so much! proportion we keep in touch more approximately your article on AOL?
    I need an expert in this house to solve my problem. May be that
    is you! Having a look ahead to look you.

  3. I would like to thank you for the efforts you have
    put in writing this blog. I’m hoping to check out the same high-grade blog posts from you later
    on as well. In fact, your creative writing abilities has motivated
    me to get my very own blog now 😉

  4. Thanks on your marvelous posting! I really enjoyed reading
    it, you are a great author.I will make sure
    to bookmark your blog and will often come back at some point.
    I want to encourage you continue your great posts, have a
    nice day!

  5. It’s genuinely very complex in this busy life to listen news on TV, therefore I simply use the web for that purpose, and take the hottest news.

  6. I like this! I haven’t ever found a post as fascinating article like yours.
    It is awesome. Is it OK to share on Twitter?

    Keep up the great work!

  7. I’m amazed, I have to admit. Rarely do I encounter a blog that’s equally educative and interesting, and
    let me tell you, you have hit the nail on the head. The issue
    is an issue that too few people are speaking intelligently about.
    I’m very happy I found this during my hunt
    for something relating to this.

  8. At this moment I am going away to do my breakfast, after having my breakfast coming
    yet again to read further news.

  9. This paragraph will assist the internet people for creating new website or even a
    weblog from start to end.

  10. Excellent post. I used to be checking continuously this weblog and I’m impressed!
    Extremely helpful information specifically the final section 🙂 I care for such info much.
    I was seeking this certain information for a very long time.
    Thanks and best of luck.

  11. This piece of writing will assist the internet visitors for creating new
    website or even a blog from start to end.

  12. hi!,I like your writing very so much! share we be in contact extra about your article on AOL?
    I need an expert in this area to solve my problem. May be that’s you!

    Having a look ahead to peer you.

  13. What’s up mates, its fantastic piece of writing regarding cultureand fully defined, keep it up all the time.

  14. Hi there would you mind letting me know which web host you’re working
    with? I’ve loaded your blog iin 3 different internet browsers and
    I must say this blog loads a loot faster then most.
    Can you suggest a good hosting provider at a honest price?
    Kudos, I appreciate it!

  15. If you would like to get much from this post then you have to apply these strategies
    to your won weblog.

  16. I am genuinely glad to glance at this web site posts which contains plenty of helpful
    information, thanks for providing these kinds of statistics.

  17. Thanks a lot. The best article I’ve ever read about the theme. Very clear and simpe and what is most important everything works perfectly.

  18. you’re actually a good webmaster. The website loading speed is amazing.
    It sort of feels that you are doing any distinctive trick.
    In addition, The contents are masterpiece. you’ve performed a great process in this subject!

Leave a Reply

Your email address will not be published.