Skip to content
Security

How to change the WordPress login URL

Move wp-login.php to a custom address with a plugin, what it does and does not protect, and how to get back in if you lock yourself out.

By WP24×7 engineers4 min readPublished November 30, 2019Updated November 29, 2026

At a glance

By default every WordPress site logs in at wp-login.php and wp-admin, and bots know it. Moving the login to a custom address cuts automated noise, and the simplest safe way is a small plugin. It is a tidy-up, not a security control: keep strong passwords, two-factor authentication, login limits and updates. Write the new address down, and know how to deactivate the plugin if you are locked out.

Updated November 29, 2026 · For WordPress site owners reducing bot traffic on the login page

  • For owners of WordPress sites with constant bot traffic on wp-login.php
  • Method a small plugin such as WPS Hide Login, with no file edits
  • Effect bots hitting wp-login.php get a 404 instead of a login form
  • Not a replacement for strong passwords, two-factor authentication, updates, backups
  • Locked out rename the plugin folder over SFTP and wp-login.php works again
  • Help emergency support or a care plan if you cannot get in

By default every WordPress site logs in at /wp-login.php and /wp-admin, and bots know it. Moving the login to a custom address cuts a lot of automated noise. The simplest safe way is a small plugin, and the most important step is writing the new address down.

What does it do and not do?

Changing the URL means bots hammering /wp-login.php get a 404 instead of a login form. That saves server load and clutters your logs less. It does not stop someone who finds the new URL, and it does not fix weak passwords. Treat it as a tidy-up and keep the real protections: strong unique passwords, two-factor authentication for every administrator, prompt updates, and a limit on failed attempts.

How do I do it?

What can go wrong?

ProblemWhat to do
CachingExclude the new login URL from page caching, or logins can fail or loop
Hard-coded linksSome themes and plugins print wp-login.php directly, such as membership or WooCommerce login forms; check them after the change
Other usersTell everyone who logs in; reset emails use the new address
Security pluginsIf one already hides the login, use one tool, not two

How do I check the change worked?

  1. Open a private window so your logged-in session does not mislead you.

  2. Confirm the new address shows the login form and /wp-login.php shows a 404.

  3. Confirm /wp-admin does not redirect a logged-out visitor to the old login.

  4. Test the "lost your password" link and its email, which should point to the new address.

  5. Log in with a second account, such as an editor.

What else should I do to protect logins?

Hiding the address helps with noise. These steps address the actual risk:

  1. Use two-factor authentication for administrators and editors, with an authenticator app rather than SMS where you can.
  2. Limit login attempts, so repeated wrong passwords are blocked for a period.
  3. Remove unused accounts, and give each person only the role they need.
  4. Do not use the username "admin". Create a new administrator and delete the old one, reassigning its content.
  5. Keep everything updated. Most compromises come through outdated plugins, not the login form.
  6. Keep backups so a bad day is recoverable.

You can also challenge the login page at the edge; see Cloudflare rules for WordPress.

Should I change the login URL at all?

It is a reasonable, low-effort measure on sites with constant bot traffic on the login page. It is not worth it if several people log in through custom forms, you use a membership or WooCommerce setup with front-end login, or you cannot test changes safely. A site's access log shows thousands of daily requests to /wp-login.php; after a hide-login plugin those return 404 and the log quiets. The same site then adds two-factor authentication and a login limit. The first change reduced noise; the other two reduced risk. Do not stop after the first.

Hiding the address reduces noise; two-factor reduces risk

Common mistakes

  • Choosing an obvious slug such as login or admin.
  • Not recording the new address anywhere.
  • Using two plugins that both move the login.
  • Forgetting to tell the team.
  • Treating this as a replacement for updates and backups.

What if I lock myself out?

What does each measure actually protect against?

MeasureWhat it doesWhat it does not do
Custom login URLCuts bot noise against /wp-login.phpStop someone who finds the address, or fix weak passwords
Two-factor authenticationBlocks stolen or guessed passwordsHide the login page
Login attempt limitsSlows repeated guessingStop a single correct guess
Updates and backupsClose known holes and allow recoveryReplace the measures above
Cannot get in, or want logins hardened for you?

Emergency support responds within 15 minutes. A care plan handles hardening routinely.

FAQ

Questions people ask

11 answers. Can't find yours? Ask an engineer.

Does changing the login URL make WordPress secure?

It reduces automated login attempts against /wp-login.php, but it is not a security control on its own. Strong passwords, two-factor authentication and updates matter more.

Link to this answer
I forgot my new login URL. How do I get in?

Deactivate the plugin by renaming its folder in wp-content/plugins over SFTP or your host's file manager. The default /wp-login.php works again.

Link to this answer
Which plugin can I use?

A free plugin such as WPS Hide Login does this without editing any files. Install it, set a new slug under Settings, General, and save.

Link to this answer
Should I do it without a plugin?

You can with web server rewrite rules or a few lines in a custom plugin, but it is easy to break password resets, wp-cron or REST requests. Unless you have a staging copy to test on, use the plugin.

Link to this answer
What slug should I choose?

Avoid obvious slugs such as login or admin, which bots also try. Pick something specific, for example team-signin, and store it in your password manager.

Link to this answer
Why do logins fail or loop after the change?

A caching plugin may be storing the new login page. Exclude the new login URL from page caching. Also check themes or plugins with hard-coded wp-login.php links.

Link to this answer
Does it work with two-factor authentication?

Yes. Two-factor works at the login form wherever it lives. Test once after the change: log out, use the new address, complete the second factor and confirm you reach the dashboard.

Link to this answer
Can I use this with a security plugin that also hides the login?

Enable only one. Using two tools that both move the login causes conflicts and can lock you out. If a security plugin already hides the login page, use that and skip the separate hide-login plugin.

Link to this answer
Should I tell my team?

Yes. Tell everyone who logs in, because password reset emails use the new address and people will otherwise report that they cannot log in.

Link to this answer
When is it not worth changing?

If several people log in through custom forms, you use a membership or WooCommerce setup with front-end login, or you cannot test changes safely. Rate limiting and two-factor authentication give more protection with less breakage risk there.

Link to this answer
What else should I do to protect logins?

Use two-factor authentication, limit login attempts, remove unused accounts, avoid the username admin, keep everything updated and keep backups.

Link to this answer

Keep reading

Want an engineer on it?

Tell us what is wrong in plain words. A person reads it, today.