add_action('init', function() { if (isset($_GET['action']) && $_GET['action'] == 'register') { wp_redirect(home_url()); exit; } });