Redirect WordPress registration page to custom page

WordPress comment four hundred and two Reading mode

The following code can redirect the link of WordPress default registration page to the custom registration page.

 Redirect WordPress registration page to custom page

Redirect WordPress registration page to custom page

Add code to the current topic function template functions.php:

 add_filter( 'register','zm_register_url' ); function zm_register_url($link){ //Change Registration Link return str_replace( site_url('wp-login.php?action=register', 'login' ),site_url( 'register', 'login' ),$link ); } add_filter( 'site_url', 'zm_fix_register_urls', 10, 3 ); function zm_fix_register_urls( $url, $path, $orig_scheme ){ //Replace Registration Link if ( $orig_scheme !== 'login' ) return $url; if ($path == 'wp-login.php?action=register') return site_url('register', 'login'); return $url; }

Modified registration link: https://zmingcx.com/register

 

Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!

 weinxin
My Wechat
Copyright Notice
Please indicate the source and link of the original article reprinted on this site. Thank you for your cooperation!
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 
 Robin
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 anonymous

Comment

Anonymous netizens
 :?:  :razz:  :sad:  :evil:  :!:  :smile:  :oops:  :grin:  :eek:  :shock:  :???:  :cool:  :lol:  :mad:  :twisted:  :roll:  :wink:  :idea:  :arrow:  :neutral:  :cry:  :mrgreen:

Drag the slider to complete validation