Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Last active July 14, 2025 11:37
Show Gist options
  • Save andrewlimaza/0e52d43cd31f21e3a125b904f3ad69ed to your computer and use it in GitHub Desktop.
Save andrewlimaza/0e52d43cd31f21e3a125b904f3ad69ed to your computer and use it in GitHub Desktop.
Logout and redirect users after successfully signing up using PMPRO
<?php
//copy lines 5-10 to your active theme's functions.php or custom PMPro plugin
function my_logout_after_register(){
wp_logout();
wp_redirect( '<SOME URL>' ); exit; //edit this line with the URL for users to be redirected to.
}
add_action('pmpro_confirmation_url', 'my_logout_after_register');
?>
@stumax
Copy link

stumax commented Aug 24, 2022

Trying this in wordpress 5.9 , the redirect does not seem to function, always gets redirected to homepage. Any ideas?
Thanks

@andrewlimaza
Copy link
Author

@stumax I'm not too sure why it's not working for you, could you please open a support ticket on www.paidmembershipspro.com/support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment