If you are doing page redirects within a WordPress theme or plugin, it is best to use the wp_redirect command. This allows others to extend or customize your plugin/theme more easily through the wp_redirect filter hook.

2. PHP Redirects – Sending Header Information

Instead of using the wp_redirect command, you can also use PHP to dynamically redirect the browser by sending appropriate header information.

Note – This will only work if the PHP redirect is issued before the page header is defined. Otherwise, an error will be triggered because you are trying to define multiple headers in a single web-page.

<?php header( 'Location: http://www.shibashake.com' ) ; ?>

The wp_redirect command uses a PHP redirect at its core, therefore, it will not work either after header information has been defined for a page.

Related Articles

How to add options to the WordPress Media Library panel. This tutorial was written based on WordPress 2.8. The same concepts will apply to WordPress 2.9, but some alterations are may be needed for handling new media actions.

Theme Switching is the process of providing the ability for the user to change the presentation styles or look of your site with the use of a Theme Switcher. The process of changing your WordPress Theme by the site Administrator is not called theme switching. ~~[ WordPress Codex ] If we wanted to switch themes or do theme switching, it seems like it would make sense to use the switch_theme WordPress command. However, this turns out not to be the case. Switch_Theme Function The switch_theme [...]