The [give_login] shortcode allows donors to login to their account on your site and optionally redirect to a specific page showing their profile information on the front end of your website.

Why use the [give_login] Shortcode?

Allowing your donors to access their profile information gives them the sense of being the owners of their data and it also lets them check their donation history and view their donation receipts.

As this shortcode allows a user to access their personal information, it is best inserted within a public page that is visible to your users.

Note: This shortcode is not added to a page automatically on install like the [give_receipt] or the [donor_history] pages are. You must add this shortcode manually to a page.
The give_login options within the GiveWP shortcode builder modal
An example of inserting the GiveWP Login Shortcode.

Using the Shortcode Builder with [give_login]

If the site uses the Classic Editor, you can make use of the GiveWP shortcode builder. It allows you to generate the shortcode to your exact specifications. Within the builder you’ll have the following options:

  • Redirect on login: This is similar to the redirect attribute, it allows the site owner to redirect the users when they successfully log in to the site
    • Shortcode attribute: login-redirect
    • Attribute values: A string containing the URL the user should be redirected to when logging in
  • Redirect on logout: This allows to redirect the users when they logout of the site
    • Shortcode attribute: logout-redirect
    • Attribute values: A string containing the URL the user should be redirected to when logging out

Deprecated GiveWP Login Shortcode Attribute

  • Redirect (deprecated): This allows the site owner to redirect the users when they successfully log in to the site, however, it was deprecated in favor of redirect on login
    • Shortcode attribute: redirect
    • Attribute values: A string containing the URL the user should be redirected to when logging in

The login-redirect attribute was added after the redirect, which was kept only for backward compatibility. You will need to use one or the other.

Examples of the GiveWP Login shortcode

Here are examples of the implementation of the [give_login] shortcode.

Default Output for logged out users

[give_login]
the login page using GiveWP
An example of the actual login view for the GiveWP Login Shortcode.

Redirecting users on login

[give_login login-redirect="https://example.com/donation-history"]

Redirecting users on logout

[give_login logout-redirect="https://example.com/"]

Redirecting users on login and logout

 [give_login login-redirect="https://example.com/donation-history" logout-redirect="https://example.com/donation-history"]

It’s a good idea to redirect your donors to their Donation History page upon successful login. But you could just as easily redirect them to a welcome page, or a restricted member page.