How Do I Automatically Redirect a Page in WordPress?

If you want to redirect a page in WordPress, you can use the wp_redirect() function. To redirect a page, you need to include the page’s slug (the unique URL for the page) as the first parameter.

The second parameter is the new URL that you want to redirect the page to. To redirect a page without including the slug, use the wp_redirect() function with the empty string as the second parameter.

In most cases, you’ll want to redirect a page to its new URL immediately after you create the redirect. You can use the wp_redirect() function to redirect a page to its new URL using the global $wp_redirect_status variable.

You can also use the wp_redirect() function to redirect a page to its new URL using the $current_blog_id variable.

If you want to redirect a page without including the slug, use the wp_redirect() function with the empty string as the second parameter. If you want to redirect a page to its new URL immediately after you create the redirect, use the global $wp_redirect_status variable.