Leave Group
Leave Group
The Leave Group widget renders a button that lets the logged-in visitor remove themselves from a LifterLMS Group. Clicking it asks for confirmation, then unenrolls the visitor from the group and redirects them. It sits in the Lifter Elements - Groups category of the Elementor widget panel.
This widget is registered only when the LifterLMS Groups add-on is installed and activated alongside Lifter Elements.
Usage
Group page template — Place the widget in a group single template built with Elementor's Theme Builder, leaving Use Current Group on. Every member sees a leave button for the group they are viewing, while leaders and admins see nothing (or your Not a Member Message).
Member account area — Turn Use Current Group off and pick a specific Group to put a leave button on a page that is not a group post, such as a custom account or settings page.
Alongside the member list — Pair it with the Group Members widget so members can see who is in the group and opt out from the same page.
How it works
The widget renders on the server; there is nothing to configure for the checks below.
| Situation | Behaviour |
|---|---|
| Visitor is not logged in, or no group can be resolved | Renders nothing. |
| Visitor's role in the group is member | Renders the button. |
| Visitor is a group leader or admin, or not enrolled in the group at all | Renders nothing, or the Not a Member Message text if you set one. Leaders and admins cannot remove themselves; another admin must remove them. |
| Button clicked | The browser shows a native confirm dialog with your Confirmation Message. Cancelling does nothing. |
| Confirmed | The form posts to a Lifter Elements handler that verifies the security token, re-checks that the visitor is a member, and calls LifterLMS Groups' enrollment removal for that group. The visitor is then redirected to the Redirect URL After Leaving, or to the LifterLMS Student Dashboard (LifterLMS > Settings > Accounts > My Account Page) if that field is empty. |
| Removal fails or the role check fails on submit | The visitor is still redirected, with legi_error=leave_failed or legi_error=not_member appended to the URL. The widget shows no error message itself. |
Unenrolling from the group is handled entirely by LifterLMS Groups; whatever course or membership access the group granted follows LifterLMS Groups' own rules for removed members. See the LifterLMS Groups documentation for details.
Settings
Content
| Setting | Description |
|---|---|
| Use Current Group | Yes (default) resolves the group from the post being viewed, which is what you want in a group template. No reveals the Group dropdown. |
| Group | Pick a specific group. Shown only when Use Current Group is No. |
| Button Text | The button label. Default Leave Group. |
| Confirmation Message | The text of the browser confirm dialog shown when the button is clicked. Default Are you sure you want to leave this group? |
| Redirect URL After Leaving | Where to send the visitor after they leave. Leave empty to redirect to the LifterLMS Student Dashboard. |
| Not a Member Message | Optional text shown in place of the button to logged-in visitors who are not a member of the group (leaders, admins, and non-members). Leave empty to render nothing for them. |
Style
| Setting | Description |
|---|---|
| Button | Typography for the button, Text Color and Background Color for the Normal and Hover states, plus Border, Border Radius, and Padding. |
Advanced
The Advanced tab holds Elementor's own layout, motion, responsive and custom-CSS controls — see Elementor's documentation. Lifter Elements adds one section, Conditional Logic, which shows or hides this widget by the visitor's LifterLMS status — see the Conditional Logic reference.
Notes
- The widget already hides itself from non-members, so you do not need a condition for that. Use the User group role or User group enrollment conditions when you want to hide surrounding content (a heading or explanatory text) for the same visitors.
- There is no success screen after leaving. If you want to show one, point Redirect URL After Leaving at a page you build for that purpose.
- Nothing renders in the Elementor editor preview; the widget only outputs on the front end for a logged-in member.