25% off ProSNIPC25OFF

Mailchimp for WP: Redirect After Successful Sign-Up

Redirects the visitor to a custom thank-you page after a successful Mailchimp for WP form submission instead of showing the inline success message.

PHPby SnipCraft
php
<?php
if ( ! function_exists( 'scseed_mc4wp_redirect_after_signup' ) ) {
    function scseed_mc4wp_redirect_after_signup( $form ) {
        if ( ! defined( 'MC4WP_VERSION' ) ) {
            return;
        }
        // Edit the slug to match your thank-you page.
        $redirect_url = home_url( '/newsletter-thank-you/' );
        wp_safe_redirect( esc_url( $redirect_url ) );
        exit;
    }
    add_action( 'mc4wp_form_success', 'scseed_mc4wp_redirect_after_signup' );
}
#forms#mailchimp#newsletter#redirect#ux