Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Redirect Users After Successful Login in WordPress

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to redirect users to a specific page after they log in to your WordPress site?

If you have an online store or a membership site, then you will want to give your newly logged-in users guidance on what to do next. Otherwise, they may end up confused and frustrated.

In this article, we will show you how to redirect users after a successful login in WordPress.

How to redirect users after a successful login in WordPress (2 ways)

Why Redirect Users After They Log in to Your WordPress Site?

If your website has multiple users, like a multi-author blog, a membership website, or an online store, then you will want to guide these users to the right place after they log in.

Many WordPress membership plugins and eCommerce plugins automatically handle redirects by showing users custom login pages and redirecting them to an account management page.

However, not all websites will be using a plugin with this functionality. In this case, users will simply be redirected to the default WordPress admin area.

While this might work for bloggers and writers, it’s not an ideal experience for people like your members and customers. 

That being said, let’s take a look at how to redirect users after a successful login in WordPress easily. You can use the quick links below to jump straight to the method you want to use:

Method 1: Setting Up Login Redirects With LoginWP

The method lets you redirect users after they sign in based on user roles, capabilities, usernames, and more. 

The easiest way to do this is using the LoginWP (formerly Peter’s Login Redirect) plugin. It lets you set up simple login redirects in a couple of clicks.

The first thing you need to do is install and activate the plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to go to LoginWP » Redirections to set up the plugin.

It allows you to set up login redirects for various situations. Let’s take a look at each of them below.

Setting Up Login Redirects for Specific WordPress Users

First, you can set up redirects only for specific users. This is useful if you have a small team and want to redirect team members to specific pages. 

To do this, click the ‘Add New’ button in the ‘Redirection Rules’ section.

Add new redirection rule

This brings you to a new page to set your redirection settings.

First, select the ‘Username’ condition from the ‘Rule Condition’ dropdown and choose the username from the dropdown list.

Add username redirection rule

Then, you can enter the URLs you want to redirect the user to on login and logout.

Make sure to click the ‘Save Rule’ button to save your changes. 

Add username login and logout URL

Setting Up Login Redirects by User Role in WordPress

Next, you can set up a login redirect based on the user role in WordPress. For example, you might want to redirect editors to the admin area but have your email list subscribers go to a separate custom page. 

The process will be similar to the steps above. Simply click the ‘Add New’ button in the ‘Redirection Rules’ section.

Then, select the ‘User Role’ condition from the ‘Rule Condition’ dropdown and choose the user role from the dropdown list. 

You can also set the order to any number, which will determine how this rule is stored and displayed in the plugin settings.

Add user role redirection role

Then, enter the login and logout URLs where you want to redirect the user role.

Next, click the ‘Save Rule’ button.

Add user role login and logout URL

If you want to create different login redirects for multiple user roles, then simply follow the same steps above. 

Setting Up Login Redirects by Capabilities in WordPress

The plugin also allows you to set up login redirects based on user levels and capabilities. This is very useful if you are using a plugin to create and manage user roles with custom capabilities in WordPress.

To do this, follow the same steps above by clicking the ‘Add New’ button.

Then, you need to select the ‘User Capability’ condition from the ‘Rule Condition’ dropdown and choose the user capability from the dropdown list.

You can also enter an order number if you want to keep your rules organized on the plugin settings page.

Add user capabilities redirection rule

You will have different user capabilities available based on the roles you have assigned.

Next, enter your login URL and logout URL in the boxes below. 

Add user capability login and logout URL

Finally, just click the ‘Save Rule’ button.

Setting Up Login Redirects for All Users in WordPress

On the plugin’s settings page, there is an option to set a redirect for all other users. If a user doesn’t match any rules you set above, then you can redirect them by entering a URL here.

You can also use this setting to create a sitewide redirect for all users.

Simply enter a login URL and logout URL into the ‘All Other Users’ section. 

Set redirect for all other users

Then, simply click the ‘Save Changes’ button.

Setting Up a User Registration Redirect in WordPress

When a new user signs up on your website, WordPress redirects them to the login page. You can set up a redirect URL to send them to any other page on your WordPress website

Simply enter the new URL in the ‘After Registration’ section and click the ‘Save Changes’ button. 

Add after user registration redirect

Method 2: Setting Up Custom Login Form and Redirects With WPForms

If you want to create a custom login form for new users, then you can use WPForms to set up a redirect after they log in. 

WPForms is the best user registration plugin on the market, used by over 6 million websites. It lets you easily create user registration forms, contact forms, and more. 

WPForms

Note: You can use the free version to create simple contact forms, but you will need WPForms Pro to get the login form feature.

The first thing you need to do is install and activate the WPForms plugin. For more details, see our beginner’s guide on how to install a WordPress plugin

Upon activation, you need to visit WPForms » Settings and enter your license key. You can find this information in your account on the WPForms website.

Enter WPForms license key

After that, you need to install the user registration form addon. 

Simply go to WPForms » Addons and locate the ‘User Registration Addon’ and click the ‘Install Addon’ button.

Install user registration addon

Now, you are ready to create your own custom login form. 

To do this, navigate to WPForms » Add New and give your form a name.

Next, search for ‘Login’ in the search bar to find the ‘User Login Form’ template, then click the ‘Use Template’ button.

Select login form template

WPForms will automatically load the User Login Form template with all the required fields.

You can edit all existing fields by clicking on them and making changes on the new screen.

WPForms form editor screen

For example, if you want to change the ‘Submit’ text, then simply click the button.

This brings you to an editor where you can add new button text, add button processing text, and more.

Click to edit form fields

Once you have finished customizing your form, you can set up a login redirect.

To do this, go to Settings » Confirmation from the left column, then select ‘Go to URL’ redirect as your confirmation type.

Then, you can enter the URL where your users will be redirected. 

Enter form redirect URL

Your login form is now ready. Make sure you click the ‘Save’ button before closing the form builder interface. 

Now, let’s add your login form to your WordPress blog or website. 

Simply open up the page where you want your login form to display or create a new page. Then, click the ‘Plus’ icon on the page edit screen to add a new block and search for ‘WPForms’.

Select WPForms block

Next, click on the WPForms block, and it will automatically be added to your site.

After that, select the login form you created earlier from the dropdown list, and it will automatically load the form inside your content area.

Select login form from drop down

Bonus Tip: Use SeedProd to Create a Custom Login Page

Alternatively, you could use a page builder plugin like SeedProd to set up a login redirect, plus create a beautiful login page.

SeedProd lets you easily create custom landing pages, login pages, 404 pages, and more.

For more details, see our guide on how to create a custom login page in WordPress.

Create SeedProd login page

Troubleshooting Login Issues in WordPress

Setting up redirects using the methods above should work like a charm. However, you might run into issues depending on how your website is set up and the WordPress plugins you are currently using.

Here are some tips that can help you resolve those issues. 

1. Update Your Permalink Structure

Simply go to Settings » Permalinks and click on the ‘Save settings’ button without making any changes.

Save permalink settings

This will refresh the WordPress permalink settings. If you are experiencing other redirect issues, then this usually does the trick.

For more information, read our guide on how to regenerate WordPress permalinks.

2. Fix Login Page Redirect Issue

If your login page keeps refreshing and redirecting you back to the login form, then this is a sign of a settings conflict.

For help troubleshooting the problem, see our guide on how to fix the WordPress login page refreshing and redirecting issue.

3. Follow General Troubleshooting Tips

If the two tips above didn’t solve your issue, then it’s most likely a plugin or theme conflict. For more details, see our beginner’s guide to troubleshooting WordPress errors.

We hope this article helped you learn how to redirect users after a successful login in WordPress. You may also want to see our guide on how to create a free business email address and our expert picks for the best live chat software for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

28 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    Thank you for the article, it solved our problem when we wanted to redirect all users except the administrator to the rules page. This worked out great and really easy thanks to WPForms. Now users have site rules available right after logging in.

  3. Kassem says

    Thanks for this post. The “troubleshooting issues” section have saved me as I’ve been trying to solve a “Cannot Modify Header Information – Header Already Sent By…” warning that kept appearing on my plugin admin pages with redirect requests, until I tried your suggestion and saved permalinks without any change.
    It worked like magic

  4. Owen Carver says

    Does this plugin allow you to make all logged in users who visit the homepage “root url” redirect to a specific page which would normally send to the homepage otherwise?

    • WPBeginner Support says

      These redirects are for directly after a user logs into the site and not when a user comes back when still logged in :)

      Admin

  5. David says

    Hi,

    I am able to successfully redirect the user to a custom page after the user logs in.

    But on logging in I see the Edit profile option is present. How can that be disabled so the user does not have access to the profile editing options?

    Regards
    David

    • WPBeginner Support says

      You would use the http_referer variable for the plugin but you would want to reach out to the support for the plugin for the specifics of how to set it up :)

      Admin

  6. sebastian says

    Hello,

    what is the limit on users?
    I am planning a site with about 2000-5000 registered WP users.

    I want everyone to have his own private area.

    thx

  7. Eric Simmons says

    I really thought I was getting the hang of WordPress. I followed the instructions and it is not working. It must be me… Because I see not other replies that it isn’t working for anyone else.

  8. s2tm says

    Hi,
    I’ve loved Peter’s login redirect for years, however, since i’ve moved to Woocommerce, i have found like many others, that woo has secured the redirect post login hook.

    And now, all my logins go to my-account.

    I’ve read Peters’ support pages, and there is mention of checking on what’s grabbing the hook, but my question is i know what it is, and now i need to know how to fix it.

    Thought i’d ask the interweb to see what she would say.

  9. Mike says

    Hi,

    I was wondering if you can help, i am looking to set up many different users, but each user will be directed to a certain page, to only see certain information
    I.E
    User 1 once logged in can only see Page 1
    User 2 once logged in can only see Page 2
    User 3 once logged in can only see Page 3.

    There could be up to 30 different users.

    Is this something you could help with? Or is there a plugin that allows this?

  10. Patrick says

    Is it possible to redirect the users to the same page they were viewing after login or registration.

  11. Chris says

    Hello, I’m using Peter’s login redirect and would like to know how to get it redirect user to their

    profile page. example.com/my-account/members/USERNAME/profile doesn’t work.

    However, example.com/my-account/members/SPECIFIC USERNAMES/profile does.

    So I can’t make it redirect to specific users unless I include their profile name in place of username

    I tired using the plugin directory: You can use the syntax [variable]username[/variable] in your URLs so that the system will build a dynamic URL upon each login, replacing that text with the user’s username. In addition to username, there is “userslug”, “homeurl”, “siteurl”, “postid-23”, “http_referer” and you can also add your own custom URL “variables”. See Other Notes / How to Extend for documentation.

    BUT it doesn’t work. Can you please help me ? Thanks.

    • WPBeginner Support says

      Please open a support thread on the plugin’s support page. Someone may have faced this issue before and the plugin author may be able to point you in the right direction.

      Admin

Leave a Reply to WPBeginner Support Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.