First off, credit where credit is due. This content is based on content found here: http://www.nathanrice.net/blog/how-to-redirect-a-page-using-custom-fields-in-wordpress/
I’ve taken Nathan Rice’s basic concept for internal and external URI redirection with custom fields in WordPress and broken it down into basic steps.
- Connect to your FTP host
- Go to the following directory (usually) /home/yoursite/public_html/wp-content/themes/yourtheme/
- Open pages.php
- Find the following line of code (usually the very first line):
<?php get_header(); ?>
- Replace it with the following code:
<?php global $post; // < -- globalize, just in case $field = get_post_meta($post->ID, 'redirect', true); if($field) wp_redirect(clean_url($field), 301); get_header(); ?>
- Save the changes and upload the file back to your FTP host
- Log in to your WordPress site (as an Administrator)
- Go to your “Pages” section and click “Add New”
- Name the page what you would like the link to be called. eg. For www.yoursite.com/abc, name the page “abc”
- Make sure that “Custom Fields” is checked in “Screen Options” (top right)
- Add a custom field called “redirect” and set the value to the URL you would like the site to redirect to
- Publish the page
Now, when you browse to your new page, you will automatically be redirected to the URL you entered.









Blog