Websnippetz

Get cool snippets on php, css, jQuery, Magento and wordpress

Change default redirection URL in wordpress

wordpress login redirect:

Open your WordPress/wp-login.php file, and find this line:
$redirect_to = admin_url();

and replace it with this:

$redirect_to = get_option('siteurl');

After login, Page will be redirected to home page

WordPress logout redirect:

find this code wp_safe_redirect( $redirect_to );  in Switch statement and in case 'logout:'

Then add this code before that line

$redirect_to = get_option('siteurl');

Modifying core file is not a good way, if you dont want to modify core file try some nice plugin for wordpress redirect.

karthi s

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: