3 comments

  1. 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);
    }
    add_filter('register','wpse127636_register_url');
    
    function wpse127636_fix_register_urls($url, $path, $orig_scheme){
        /*
            Site URL hack to overwrite register url     
            http://en.bainternet.info/2012/wordpress-easy-login-url-with-no-htaccess
        */
        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);
    
  2. 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 */
    
  3. Use the register_url filter

    add_filter( 'register_url', 'change_my_register_url' );
        function change_my_register_url( $url ) {
            if( is_admin() ) {
                return $url;
            }
            return "/custom-register-url/";
        }
    

Comments are closed.