Contents
- 1 Activating the Custom Redirects Add-on
- 2 Setup the Custom Redirects Addon
- 3 Custom Redirects Types
- 4 Individual User Redirects
- 5 User Role based Redirects
- 6 Global Redirects
- 7 Redirect Default WordPress Forms and Pages
- 8 Redirects Priority
- 9 Available tags for dynamic URLs
- 10 Individual redirects defined in shortcodes
Activating the Custom Redirects Add-on
The Custom Redirects add-on is available only with a Profile Builder Pro license.
After purchasing the Pro version of Profile Builder, you can check the following guide on how to install Profile Builder.
Setup the Custom Redirects Addon
After you’ve activated the Add-on, 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.
The Custom Redirects addon provides an easy-to-use interface for keeping your users out of the WordPress dashboard or to redirect them after specific actions.
Inside the addon we can setup:
- Individual User Redirects – You can setup redirects based on User ID or Username
- User Role based Redirects – You can setup redirects based on User Role
- Global Redirects – You can setup redirects for all your users
- Redirect Default WordPress Forms and Pages – You can setup redirects if users try to access the default WordPress Forms and Pages
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 Password Change Request
- After Successful Password Reset
- Dashboard (redirect users from accessing the dashboard)
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.
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.
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.
Setting a redirect After Logout will also work when using the default WordPress Logout functionality.
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 )
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.
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:
- Multiple Registration and Edit Profile form settings Redirects
- Individual User Redirects
- User Role based Redirects
- Global Redirects
- 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.
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 than 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
- {{redirect_to}} – The default URL set by WordPress after login
Examples
You can use the {{homeurl}} tag to redirect users After Registration to your homepage
You can use the {{siteurl}} tag to redirect users After Registration to your site URL
You can use the {{user_id}} tag to redirect users After Login to your products page based on their user ID
You can use the {{user_nicename}} tag to redirect users After Login to their Private Page created with Client Portal plugin
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"]
Profile Builder Pro
Create beautiful front-end registration and profile forms with custom fields. Setup member directories, custom redirects, cutomize user emails & more using the all in one user management plugin.
Unlock PRO Features