😆Change Login URL Without Plugin

https://wordpress.stackexchange.com/questions/160098/change-login-url-without-plugin

C:\xampp82\htdocs\wp2\wp-content\themes\kadence-child\functions.php

add_filter('login_url', 'my_login_page', 10, 2);
function my_login_page($login_url, $redirect)
{
  return str_replace("wp-login.php", "signin", $login_url);
}
add_action('login_form', 'replace_login_submit_form', 1);
function replace_login_submit_form()
{
  $your_content = ob_get_contents();
  $your_content = str_replace("wp-login.php", "signin", $your_content);
  ob_get_clean();
  echo $your_content;
}

C:\xampp82\htdocs\wp2.htaccess

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^signin(.*) wp-login.php?%{QUERY_STRING}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Last updated