wp_redirect not working from shortcode function
Why does it need to be a Shortcode? Looks like a XY Problem. You’re already inserting the shortcode manually in the edit screen. Use a Custom Field instead and hook earlier where you can actually do the redirect. add_action( ‘template_redirect’, function(){ global $post; $redirect = get_post_meta( $post->ID, ‘redirect’, true ); if( $redirect ) { wp_redirect( … Read more