5.3 Set Auto-login to WordPress Website

Estimated reading: 4 minutes 109 views

This auto-login feature allows your customers to log in without a password. It’s especially useful for automatic login after purchase. If the user is not yet registered on your website, it will automatically register and log them in as a new user.

Best use cases

  • When a new user purchases their first item.
  • When a user forgets their password — give them this link to auto-login and update their password.
  • When someone makes a purchase in GHL, redirect them to WordPress and automatically log them in.

🔐 Secure Auto Login Setup Guide

We recommend using the auto-login link as a trigger link and storing the authentication key in a custom value, so you can easily change it when needed. To ensure everything stays secure, follow these steps carefully.:


Step 1: Add an Authentication Key

In your plugin options page, add an authentication key.
This key acts as a password — keep it safe and change it periodically just like your regular password.
If you want to disable the auto login feature, simply leave this field blank.

Auto Login Authentication Key


Step 2: Create a Custom Value in Your CRM

In your GoHighLevel CRM, create a custom value named lcw_auth_key and set its value to match the authentication key you added in Step 1.


Step 3: Create a Trigger Link

Next, create a trigger link inside your CRM using the following pattern:

website_link?lcw_auto_login=1&lcw_auth_key=authentication_key&email=customer_email&set_tags=level_1,level_2&remove_tags=idle_user&redirect_to=link_to_redirect_after_login&success_message=Great! You logged in successfully.&id=123456789&first_name=John&last_name=Doe

🔍 Explanation of Parameters

Parameter Status Description
website_link (Mandatory) The base website URL where the customer will be logged in.
lcw_auto_login (Mandatory) Required parameter; its value should always be 1.
lcw_auth_key (Mandatory) The authentication key you set up in Step 1.
email (Mandatory) The email address of the customer who will be logged in.
id (Optional) The GHL Contact ID. You need to pass this if you want to create a new user.
If you pass this and the user doesn’t exist, a new user will be created using this ID as their password.
first_name (Optional) The contact’s first name. You only need to pass this if a new user is being created.
last_name (Optional) The contact’s last name. You only need to pass this if a new user is being created.
set_tags (Optional) Comma-separated tags you want to apply to the contact. Example: level_1,level_2
remove_tags (Optional) Comma-separated tags you want to remove from the contact. Example: idle_user
redirect_to (Optional) The slug of the page where the user will be redirected after login. Default: Home page.
success_message (Optional) A custom message displayed when the login is successful.

🧠 Example Trigger Link

Here’s what your trigger link might look like:

A simple autologin link

{{ custom_values.membership_wp_website_link }}?lcw_auto_login=1&lcw_auth_key={{ custom_values.lcw_auth_key }}&email={{ contact.email }}&redirect_to=dashboard

For a new user add the first name & last name

{{ custom_values.membership_wp_website_link }}?lcw_auto_login=1&lcw_auth_key={{ custom_values.lcw_auth_key }}&email={{ contact.email }}&first_name={{ contact.first_name }}&last_name={{ contact.last_name }}&redirect_to=dashboard

If you need to apply or remove tag based on autologin

{{ custom_values.membership_wp_website_link }}?lcw_auto_login=1&lcw_auth_key={{ custom_values.lcw_auth_key }}&email={{ contact.email }}&set_tags=level_1,level_2&remove_tags=idle_user&redirect_to=dashboard

If you need to add a custom message

{{ custom_values.membership_wp_website_link }}?lcw_auto_login=1&lcw_auth_key={{ custom_values.lcw_auth_key }}&email={{ contact.email }}&success_message=Hey! This is a custom message&redirect_to=dashboard

Provide this link to the customer for direct access to their purchased item.
You can send the trigger link directly, or link it to a button or text in your CRM messages/ or in email.


💡 Pro Tip: Always test your trigger link before sending it to real customers to ensure smooth login and redirect behavior.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

5.3 Set Auto-login to WordPress Website

Or copy link

CONTENTS