Paid Memberships Pro: Custom Thank-You Page per Level
Sends new members to a different confirmation page for each level after checkout, for example an onboarding page for your premium tier.
Opens WPIDE on
Code
if ( ! function_exists( 'pmpro_url' ) ) {
return;
}
// Level ID => thank-you URL.
$wpide_pmpro_thanks = array(
2 => home_url( '/welcome-premium/' ),
);
add_filter( 'pmpro_confirmation_url', function ( $url, $user_id, $level ) use ( $wpide_pmpro_thanks ) {
$level_id = is_object( $level ) ? (int) $level->id : (int) $level;
return $wpide_pmpro_thanks[ $level_id ] ?? $url;
}, 10, 3 );
Notes
Levels not listed keep PMPro's normal confirmation page.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.