Custom Redirect for Specific Pages

Create a shortcode that generates a contact form.

<?php
function custom_page_redirect() {
    if (is_page('old-page')) {
        wp_redirect(home_url('/new-page'));
        exit;
    }
}
add_action('template_redirect', 'custom_page_redirect');
?>

Post Comment