Custom Redirects

The Custom Redirects module is available only with a Profile Builder Pro license.

Activating the Custom Redirects module

In order to activate the Custom Redirects module you will need to go to the Modules tab and under the Custom Redirects status select Active then click Save Changes.

Profile Builder - User Listing - Activate Module

After this a new Custom Redirects tab will show up in the Profile Builder Admin interface. You can now setup Custom Redirects to redirect your users on your website in any way you desire.

Setup the Custom Redirects module

The Custom Redirects module provides an easy to use interface for keeping your users out of the WordPress dashboard or to redirect them after specific actions.

Inside the module we can setup:

Profile Builder Pro - Custom Redirects - Setting up Redirects

Custom Redirects Types

Inside the Redirect Type option you can setup a redirect to an URL based on a specific action:

  • After Login
  • After Logout
  • After Registration
  • After Edit Profile
  • After Successful Email Confirmation
  • After Successful Password Reset
  • Dashboard (redirect users from accessing the dashboard)

Profile Builder Pro - Custom Redirects - Redirect Types

Individual User Redirects

Inside the Individual User Redirects tab you can create redirects based on User ID or Username. For example, After Login, you can redirect the user with the ID 10 in one place and user johndoe in another place.

Profile Builder Pro - Custom Redirects - Individual User Redirects

User Role based Redirects

Inside the User Role based Redirects tab you can create redirects based on User Role. For example Subscribers will be redirected to the forum After Edit Profile but Authors will not be redirected.

Profile Builder Pro - Custom Redirects - User Role based Redirects

Global Redirects

Inside the Global Redirects tab you can create redirects for all your users. For example all your users will be redirected to the Login page After Registration.

Profile Builder Pro - Custom Redirects - Global Redirects

Setting a redirect After Logout will also work when using the default WordPress Logout functionality.

Profile Builder Pro - Custom Redirects - Global Redirects After Logout

Redirect Default WordPress Forms and Pages

Inside the Redirect Default WordPress Forms and Pages tab you can setup redirects if users try to access the default WordPress Forms and Pages. These redirects are applied on default WordPress page requests:

  • Login ( wp_login.php )
  • Register ( wp-login.php?action=register )
  • Lost Password ( wp-login.php?action=lostpassword )
  • Author Archive ( http://sitename.com/author/admin )

Profile Builder Pro - Custom Redirects - Redirect Default WordPress Forms and Pages

Using this you can keep your users out of the WordPress admin interface and redirect them to the Front End forms created with Profile Builder: Registration, Login, Edit Profile, Recover Password.

Profile Builder Pro - Custom Redirects - Redirect Default WordPress Forms and Pages Setup

Redirects Priority

Each redirect is triggered based on its priority. For example the Multiple Registration and Edit Profile form settings Redirects will happen before the Global Redirects:

  1. Multiple Registration and Edit Profile form settings Redirects
  2. Individual User Redirects
  3. User Role based Redirects
  4. Global Redirects
  5. Individual redirects defined in shortcodes – The redirect_priority=”top” parameter can be added in any shortcode, then that shortcode redirect will have priority over all other redirects.

Profile Builder Pro - Custom Redirects - Redirects Priority

Available tags for dynamic URLs

You can use the following tags in your URLs to redirect users to various pages:

  • {{homeurl}} – Generates a url of the current website homepage.
  • {{siteurl}} – In WordPress the site url can be different then the home url
  • {{user_id}} – The ID of the user
  • {{user_nicename}} – The URL sanitized version of the username, the user nice name can be safely used in URLs since it can’t contain special characters or spaces
  • {{http_referer}} – The URL of the previously visited page

Profile Builder Pro - Custom Redirects - Available tags for dynamic URLs

Examples

You can use the {{homeurl}} tag to redirect users After Registration to your homepage

Profile Builder Pro - Custom Redirects - Homeurl

You can use the {{siteurl}} tag to redirect users After Registration to your site URL

Profile Builder Pro - Custom Redirects - Site URL

You can use the {{user_id}} tag to redirect users After Login to your products page based on their user ID

Profile Builder Pro - Custom Redirects - User ID

You can use the {{user_nicename}} tag to redirect users After Login to their Private Page created with Client Portal plugin

Profile Builder Pro - Custom Redirects - User Nice Name

You can use the {{http_referer}} tag to redirect users After Login to the previously visited page

Individual redirects defined in shortcodes

You can define redirects in Profile Builder shortcodes by using the redirect_url or the logout_redirect_url argument.

The redirect_priority argument can be added in any shortcode and that redirect will have priority over all other redirects.

Registration

Redirect after Registration

[wppb-register redirect_url="http://www.yourdomain.com/page"]

Redirect after Logout

[wppb-register logout_redirect_url="http://www.yourdomain.com/page"]

Redirect with Priority

[wppb-register redirect_url="http://www.yourdomain.com/page" redirect_priority="top"]

Login

Redirect after Login

[wppb-login redirect_url="http://www.yourdomain.com/page"]

Redirect after Logout

[wppb-login logout_redirect_url="http://www.yourdomain.com/page"]

Redirect with Priority

[wppb-login redirect_url="http://www.yourdomain.com/page" redirect_priority="top"]

Edit Profile

Redirect after Editing the Profile

[wppb-edit-profile redirect_url="http://www.yourdomain.com/page"]

Redirect with Priority

[wppb-edit-profile redirect_url="http://www.yourdomain.com/page" redirect_priority="top"]