WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How it possible to redirect all users, even administrators after login to specific page? And also redirect users after successful registration? Any simplest way? For example I want to redirect users after login, to the "Updates" page of my website. And after registration, to the "Home" page of website.

share|improve this question
up vote 1 down vote accepted

This code adapted from: Registration Redirect

add_filter( 'registration_redirect', 'ckc_registration_redirect' );
function ckc_registration_redirect() {
    return home_url();

This code adapted from: Login Redirect

add_filter( 'login_redirect', 'ckc_login_redirect' );
function ckc_login_redirect() {
    // Change this to the url to Updates page.
    return home_url( '/Updates' );

Add the code to the functions.php theme (or child theme) file.

share|improve this answer
Above codes goes in theme's function.php. When theme changed, again both pages redirect to their default locations. How we can redirect by changing WP core files? – John Doe May 5 '13 at 16:50
Never change the core files. Changes will be removed when WordPress updates. You could do this from a plugin to make them theme independent. – Charles Clarkson May 5 '13 at 18:39

To globally redirect after successful login, find this code in wp-login.php, under <form name="loginform"> section.

<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />

and replace <?php echo esc_attr($redirect_to); ?> with your URL where you want to redirect. The URL must start with http:// and ends on /other wise page redirect to default location.

Do same thing form redirect after registration with in same file but under <form name="registerform"> section.


This method involves changing WordPress core code. It is rarely recommended by any serious WordPress programmer. Proceed at your own risk.

share|improve this answer

With plugin:


share|improve this answer

To add one more to the list for logout:

function go_home(){
  wp_redirect( home_url() );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.