How to Change your WordPress Login Page URL (Security Tip)

To change your WordPress login URL, install a plugin like WPS Hide Login and set a custom slug under Settings > General. Your old /wp-login.php address then returns a 404, and logged-out visits to /wp-admin/ get redirected away, so the bots hammering those URLs get nowhere.

WordPress itself has no setting for this, so a plugin (or the hide-login feature inside a security plugin) is the reliable route. Before you save, bookmark the new URL. And keep in mind that a hidden login page cuts noise but is not a replacement for a strong password and two-factor authentication. More on both below.

Key Takeaways
  • WordPress has no built-in setting for the login URL. Use a plugin: WPS Hide Login (free, single purpose) or the hide-login feature in Kadence Security, All-In-One Security, or ASE.
  • With WPS Hide Login active, /wp-login.php returns a 404 and logged-out visits to /wp-admin/ get redirected, while your custom slug shows the login form.
  • This is security through obscurity. It cuts bot noise but does not replace a strong password, two-factor authentication, and login rate limiting.
  • Forgot the custom URL? Run wp option get whl_page, or rename the plugin folder over SFTP to get /wp-login.php back.
  • Do not edit or rename wp-login.php yourself. A core update puts the original file back.

Video Tutorial

If you want to quickly see how to change your site’s login URL, check out my video below.

No time for a video? Keep reading below.

Why You Should Change Your WordPress Login Page URL

Every WordPress site exposes its login page at the same addresses: /wp-login.php, plus /wp-admin/ and a few core shortcuts like /login/ that redirect there. WordPress is also the most used CMS on the internet, so brute-force scripts can point at those paths without checking what a site runs.

Moving the login page to a custom URL means those bots hit a 404 instead of your login form. You get less server load, cleaner logs, and far fewer failed logins to sort through. It will not stop someone targeting you who finds the new URL, but it removes the constant background noise of broad, automated attacks.

Ways to Change the WordPress Login URL

Here is how the common options compare. Names, install counts, and features come from each plugin’s WordPress.org page.

MethodCostActive installsWhat else it doesWatch out for
WPS Hide LoginFree2M+Nothing, it only moves the login pagePage caches other than WP Rocket need the slug excluded
Kadence SecurityFree, Pro available700K+2FA, brute force protection, file change detectionFormerly Solid Security and iThemes Security, so older tutorials use those names
All-In-One Security (AIOS)Free, Premium available1M+Firewall, login lockouts, 2FAThe feature is called Rename Login Page
Admin and Site Enhancements (ASE)Free, Pro available200K+Dozens of admin tweaks in one pluginMultisite is not officially supported; WooCommerce login compatibility is a Pro feature
WordfenceFree, Premium available5M+Firewall, malware scan, 2FA, login CAPTCHADoes not change the login URL; it defends the default one
Editing or renaming wp-login.phpFreen/aNothingUndone by the next core update, and easy to lock yourself out
Ways to change (or protect) the WordPress login URL. Install counts from WordPress.org, November 2026.

If you only want the URL moved, WPS Hide Login is the simplest choice. If you already run a security plugin, use its built-in option instead of stacking a second plugin that touches the login page. On my serious sites I use Kadence Security Pro for 2FA and rate limiting, and I cover why in my WordPress login security guide.

How to Change Your WordPress Login Page URL with a Plugin

The easiest and most reliable option is the free WPS Hide Login plugin. According to its plugin page, it does not rename core files or add rewrite rules. It intercepts requests to the login page, and deactivating it puts the site back exactly as it was.

  • Search for WPS Hide Login in Plugins>add new, then install and activate it.
  • Go to Settings>general and scroll to the WPS Hide Login section at the bottom.
  • Enter your new slug in the Login url field. Optionally change Redirection url, which is where logged-out visits to wp-admin and wp-login.php go (the default is 404).
  • Bookmark the new URL, then click Save Changes. The plugin shows a notice with your new login link.
WPS Hide Login settings in WordPress general settings
WPS hide login options

The change takes effect the moment you save, and the default URLs stop working right away. If you never set a slug, the plugin falls back to /login/, so pick your own. Something memorable is fine, and tell your other admins before you save.

What actually changes (tested)

On a fresh WordPress 7.1.4 site in WordPress Playground, with WPS Hide Login 1.9.19 active and the slug set to secret-door, this is what each URL returned while logged out:

Request (logged out)Without the pluginWith WPS Hide Login (slug: secret-door)
/wp-login.phpLogin form404
/wp-admin/Redirect to wp-login.phpRedirect to /404/ (the default Redirection url)
/login/Redirect to wp-login.php (core shortcut)No redirect, normal front-end page
/secret-door/Not a login pageLogin form
/wp-login.php?action=lostpasswordLost password form404 (use /secret-door/?action=lostpassword)
/xmlrpc.phpReachableStill reachable
Tested on WordPress 7.1.4 with WPS Hide Login 1.9.19 in WordPress Playground.

Two things stood out. The plugin disables core’s /login/ shortcut so it no longer leads to the form, and the lost password and registration links move to your new slug too (for example /secret-door/?action=register). XML-RPC is untouched, which matters for the next section.

Don’t Stop at the Login URL

Changing your login URL is security through obscurity. It hides the door, but it does not strengthen the lock. If a bot or a person finds the new URL, a weak password still falls. Pair the URL change with the measures that actually protect the login:

  • Use a strong, unique password, and avoid the username “admin”. This matters more than anything else on this page.
  • Turn on two-factor authentication, so a correct password alone is not enough to get in.
  • Limit login attempts. Limit Login Attempts Reloaded (now listed as Limit Login Attempts Security) locks out an IP or username after repeated failures, and it covers xmlrpc.php as well as wp-login.php.
  • Disable or block XML-RPC if nothing you use needs it, since bots can try passwords there without ever touching the login page.

Avoid Editing Core Files or .htaccess by Hand

You will find tutorials that rename wp-login.php or edit it directly, and others that add redirect rules to functions.php or .htaccess. Skip these on a live site:

  • A core update replaces the files that ship with WordPress, so your renamed or edited wp-login.php gets put back (see the upgrading docs).
  • Hand-written redirects often miss the logout, password reset, and registration links, which all point at wp-login.php.
  • An IP rule in .htaccess locks you out the moment your home IP changes.

A maintained plugin handles all of those URLs together and reverses cleanly when you deactivate it, which is why it is the safer route.

How to Get Back In If You Forget the Custom Login URL

This is the most common problem with any hide-login setup. You have three ways back in, from least to most drastic.

1. Look up the slug

WPS Hide Login stores the slug in the whl_page option. With SSH and WP-CLI, this prints it:

wp option get whl_page

No SSH? Open phpMyAdmin from your host, browse the wp_options table, and search for whl_page. On a multisite where the plugin is network activated, check the sitemeta table, or run wp site option get whl_page.

2. Deactivate the plugin with WP-CLI

wp plugin deactivate wps-hide-login

In the Playground test, /wp-login.php worked again immediately after this. The whl_page value stays in the database, so reactivating the plugin brings back the same slug.

3. Rename the plugin folder over SFTP

If you only have file access, connect with SFTP or your host’s file manager and rename the plugin folder in wp-content/plugins. From a shell in the WordPress root, that looks like this:

mv wp-content/plugins/wps-hide-login wp-content/plugins/wps-hide-login-off

WordPress can no longer load the plugin, so /wp-login.php comes back (confirmed in the same test). Log in, open the Plugins screen so WordPress marks the plugin as deactivated, then rename the folder back and reactivate it. The same trick works for a security plugin that moved your login page; our plugin conflict guide covers renaming folders in more detail.

Troubleshooting and Things to Watch For

  • Page caching: if you use a page cache other than WP Rocket, the WPS Hide Login docs say to add your login slug to the never-cache list. Do the same for a CDN that caches HTML, such as a Cloudflare cache-everything rule, or visitors can get a cached login page or a redirect loop.
  • Multisite: WPS Hide Login works with subdomain and subfolder networks. Network activation gives you a network-wide default under Network Settings, and each site can still set its own slug. ASE does not officially support multisite.
  • Hardcoded links: plugins or themes that hardcode wp-login.php instead of using wp_login_url() will send people to a 404.
  • Comment login links: if “Users must be registered and logged in to comment” is enabled, the plugin warns that the login link in the comment form is not hidden.
  • A 404 on the new URL: re-save your permalinks under Settings > Permalinks to flush the rewrite rules, then try again in a private window.

Frequently Asked Questions

What is the default WordPress login URL?

It is yoursite.com/wp-login.php. Visiting yoursite.com/wp-admin/ while logged out sends you there too, and core also redirects the shortcuts /login, /admin, and /dashboard through the wp_redirect_admin_locations() function. If you are not sure which address your site uses, see how to find your WordPress login URL.

Can I change the WordPress login URL without a plugin?

Not cleanly. There is no setting for it in core, and the do-it-yourself routes (renaming wp-login.php or adding rewrite rules) break on updates or miss the logout and password reset links. If you want to avoid a dedicated plugin, use the hide-login option in a security plugin you already run, or protect wp-login.php at the server level with HTTP authentication or an IP allowlist, which locks the door rather than moving it.

I forgot my custom login URL. How do I find it?

For WPS Hide Login, the slug is stored in the whl_page option. Run wp option get whl_page over SSH, or look for whl_page in the wp_options table in phpMyAdmin. On a network-activated multisite it can be in the sitemeta table instead (wp site option get whl_page). If you have no database access, rename the plugin folder over SFTP and log in at /wp-login.php.

Does changing the WordPress login URL improve security?

It reduces automated login attempts and log noise, but it does not stop someone who finds the new address, and it does nothing for XML-RPC. Treat it as the last layer after a strong password, two-factor authentication, and rate limiting.

Does Wordfence change the login URL?

No. Wordfence protects the default login page with rate limiting, 2FA, CAPTCHA, and its firewall instead of hiding it. You can run WPS Hide Login alongside it if you want both.

Hiding the login page is one quick piece of a layered setup. Change the URL, bookmark it, and then spend the time that matters on 2FA and rate limiting.

Picture of Andy Feliciotti

Andy Feliciotti

Andy has been a full time WordPress developer for over 15 years. Through his years of experience has built 100s of sites and learned plenty of tricks along the way. Found this article helpful? Buy Me A Coffee

4 Responses

  1. Hello,
    Once I use the plugin to change my login url, do I still need the plugin to remain activated?

    Thank you.

    Sincerely,
    Tom

  2. thanks a lot:D I´m helping a friend her site is constantly under brute force attack, this help I think thanks so much^^

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Tips Monthly
Get the latest from SmartWP to your inbox.