How to Redirect Users after Successful Login in WordPress

Check Out More At: WP Beginner

WordPress: Best WordPress Plugins | WordPress Tutorials

How to Redirect Users after Successful Login in WordPress

Product Image Product Name / Primary Rating / Price Primary Button / Description
Best Wordpress Page Builder
  • Description:

    Elementor is an amazing website builder plugin for WordPress. Elementor makes it easy to create beautiful and high converting websites yourself without having to learn code.

Best WordPress Form Builder
  • Description:

    Gravity Forms is a WordPress plugin that creates powerful forms quickly and easily, with drag-and-drop fields, custom notifications and confirmations, and custom styling capability.

Best WordPress Theme
  • Description:

    Kadence Theme is a powerful, intuitive and flexible WordPress theme that offers an expansive set of features and customization options.

    It includes a robust page builder, beautiful design options, mobile-friendly responsiveness, powerful SEO tools and optimized performance for faster loading times.

    It's perfect for creating stunning websites without needing to write any code.

Best Wordpress Cloud Hosting
  • Description:

    Cloudways is a managed cloud hosting platform that simplifies cloud infrastructure deployment and management.

    It provides an intuitive dashboard, automated backups and optimized stack for speedy performance. It also provides 24x7 support with multiple server locations, enabling businesses to host their applications quickly and securely.

Best Budget WordPress Host
  • Description:

    Bluehost is an easy to use web hosting provider offering reliable, secure and affordable hosting solutions with 24/7 customer support.

Best Wordpress Page Builder
4.5
N/A
Description:

Elementor is an amazing website builder plugin for WordPress. Elementor makes it easy to create beautiful and high converting websites yourself without having to learn code.

Best WordPress Form Builder
3.5
N/A
Description:

Gravity Forms is a WordPress plugin that creates powerful forms quickly and easily, with drag-and-drop fields, custom notifications and confirmations, and custom styling capability.

Best WordPress Theme
3.5
N/A
Description:

Kadence Theme is a powerful, intuitive and flexible WordPress theme that offers an expansive set of features and customization options.

It includes a robust page builder, beautiful design options, mobile-friendly responsiveness, powerful SEO tools and optimized performance for faster loading times.

It's perfect for creating stunning websites without needing to write any code.

Best Wordpress Cloud Hosting
3.5
N/A
Description:

Cloudways is a managed cloud hosting platform that simplifies cloud infrastructure deployment and management.

It provides an intuitive dashboard, automated backups and optimized stack for speedy performance. It also provides 24x7 support with multiple server locations, enabling businesses to host their applications quickly and securely.

Best Budget WordPress Host
4.0
$3.95/Mo
Description:

Bluehost is an easy to use web hosting provider offering reliable, secure and affordable hosting solutions with 24/7 customer support.

Lasso Brag

After a successful login in WordPress, you may want to redirect your users to a specific URL. This can be done by using a simple plugin or adding a code snippet to your functions.php file.

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

Method 1: Redirect Users After Successful Login in WordPress Using a Plugin

First thing you need to do is install and activate the Peter’s Login Redirect plugin. Upon activation, you need to visit Settings » Login Redirect page to configure the plugin settings.

The plugin allows you to redirect users to specific pages based on user roles. You can also set a default redirect URL for all users.

Method 2: Redirect Users After Successful Login in WordPress Without a Plugin

If you don’t like plugins or if you are already using a plugin that allows you to customize the WordPress login page, then you can add a code snippet to your child theme’s functions.php file or site-specific plugin.

function wpb_s_login_redirect() {

global $current_user;

get_currentuserinfo();

if (is_user_logged_in()) {

if (current_user_can(‘administrator’)) {

echo “Howdy “. $current_user->user_login .”, \n\n”;

} else {

echo “Howdy guest, \n\n”;

}

} else {

echo “You are not logged in”;

}

}

Similar Posts