Website Building » WordPress » How do I redirect a WordPress login page?

How do I redirect a WordPress login page?

Last updated on September 25, 2022 @ 12:42 am

If you want to redirect a WordPress login page to a different URL, you can do so by editing the wp-config.php file. To do this, open the file in a text editor and locate the line that reads:

define( ‘AUTH_URL’, ‘http://site.com/wp-login.php’);

Change the URL to the URL you want to redirect users to. For example, if you want to redirect users to the login page for your blog on the domain blog.com, you would type:

PRO TIP: If you are considering redirecting your WordPress login page, be aware that this can have unintended consequences. For example, if you are using a custom login page and redirect it to another URL, you may find that users are unable to login. Additionally, if you are using WordPress as a membership site, redirecting the login page can cause confusion for your members.

define( ‘AUTH_URL’, ‘http://blog.php’);

If you want to redirect users to the login page for your blog on the domain blog.com, but only if they are not logged in, you would type:

define( ‘AUTH_URL’, ‘http://blog.

php?redirect_to=%2Fwp-login.php’);.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.