Default Page Redirect

David Bullock — 

This text entry field specifies what page a user will be redirected to, by default, it is the site’s login page.

This setting supports the following placeholders:

{{current.url}} which substitute in the current URL.

{{member.homepage}} which substitutes the URL of the logged in user’s dashboard page. If there is no login page, the home page of the site is substituted.

{{member.logout}} which substitutes the URL of the logged in user’s logout page.

For example to redirect to the standard WordPress Login page and redirect back, you would set the default redirect to:

Smart Redirects™

As of version 2.49, you can now use shortcodes in the redirect URL, including partials, and custom shortcodes. Using Smart Redirects, the output of the shortcodes is the URL that the page is redirected to.

For a simple shortcode rule set that you’re only going to use one, you can place the actual shortcodes directly into the redirect URL input box. We would define a simple shortcode rule set as consisting of no more than one conditional shortcode.

If you have a more complex set of rules, more than one conditional shortcode, or you are going to reuse the rules, then we would recommend using a Partial as a best practice. Using a partial you can easily create and manage your ruleset, and then paste the partial shortcode anywhere you want to use that redirect rule.

How to Redirect a Visitor Back to The Same Page After Login

A common question that we get is, “How can i redirect a user to a login page when he tries to access restricted content and send him back to the same page after he logs in?”

This video walks you through how to set your membership site up to do that…

Example Applications

Simple ideas for how you can use Smart Redirects™ include redirecting based on login status, redirecting based on membership level, redirecting based on access to a particular page/post, redirecting based on random numbers, or inserting member specific data into the URL link, such as BuddyPress profile page URL’s, or even URL parameters or form inputs.

  • Was this Helpful?
  • YesNo