WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am just trying to change the url of "register" on wp default login page(domain.com/wp-login.php)

  1. I want to change the url on register link.

  2. when you are on domain.com/wp-login.php?action=register, I want to redirect to domain.com/register

I have added redirect link. but it's not working.

 RedirectMatch 301 /wp-login.php?action=register$ http://domain.com/register/$1

Am I missing something?

I just want to use my register page (domain.com/register/)

share|improve this question
up vote 1 down vote accepted

Code from @bainternet's website.

function wpse127636_register_url($link){
        Change wp registration url
    return str_replace(site_url('wp-login.php?action=register', 'login'),site_url('register', 'login'),$link);

function wpse127636_fix_register_urls($url, $path, $orig_scheme){
        Site URL hack to overwrite register url     
    if ($orig_scheme !== 'login')
        return $url;

    if ($path == 'wp-login.php?action=register')
        return site_url('register', 'login');

    return $url;
add_filter('site_url', 'wpse127636_fix_register_urls', 10, 3);
share|improve this answer
works well. thanks – pulla Dec 29 '13 at 6:23

Put this code in your Theme's "functions.php" file. Replace the page ID with where it says [REPLACE WITH YOUR PAGE ID HERE].

/* start  */ 
add_filter( 'register_url', 'custom_register_url' );
function custom_register_url( $register_url )
    $register_url = get_permalink( $register_page_id = [REPLACE WITH YOUR PAGE ID HERE] );
    return $register_url;
/* end */
share|improve this answer
Add some explanation saying how this code fits for the Question. – Mayeenul Islam Jul 16 '14 at 4:08
No it's not working I added post id but when I go to /wp-login, it doesn't redirect. anyway thank you. – pulla Jul 16 '14 at 7:04
It should work if dont correctly. did you add the numerical value of the page, to which you want to redirect? PS: you don't need to edit or change anything on the wp-login.php file itself. Just add this code in the functions.php file will do. – intec infosys Jul 19 '14 at 10:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.