This page template is designed to provide us with a simple and fast way to redirect WordPress pages using 301 seo friendly redirects. This approach is based on using Custom Fields and a specific Page Template, aiming to make dealing with page redirects as simple as possible.
Originally I created this redirect template prior the WP3 era when needed to have multiple links (with different names) to the same page in the menu. Now since WP3 this can be solved with Custom Menus using the wp_nav_menu() function where links within the menu are created manually and multiple links to the same page or even external links are not an issue anymore. But in cases when we want to display a link to a new page in the menu as soon as it was published, using the classic WP menus does makes more sense as we don’t need to create the links manually.
You can download the template here:
Here are simple steps on how to use this 301 redirect template:
- Download the redirect template, unzip and upload into your WP theme.
- On the right hand side in your Attributes box, select the Redirect Page for the page you wish to redirect.
- Create a new custom field called redirect in your Custom Fields box below the main post content edit field, and give it the link you wish redirect to as a value.
alternatively you can use the Page ID instead of the URL, which is a better solution as when the URL changes the redirect will still work.
That’s all there is to it. Happy redirecting.