Skip to main content

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.

Requires LifterLMS Groups

This widget is registered only when the LifterLMS Groups add-on is installed and activated alongside Lifter Elements.

Lifter Elements Leave Group button rendered on a group page

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.

SituationBehaviour
Visitor is not logged in, or no group can be resolvedRenders nothing.
Visitor's role in the group is memberRenders the button.
Visitor is a group leader or admin, or not enrolled in the group at allRenders nothing, or the Not a Member Message text if you set one. Leaders and admins cannot remove themselves; another admin must remove them.
Button clickedThe browser shows a native confirm dialog with your Confirmation Message. Cancelling does nothing.
ConfirmedThe 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 submitThe 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

SettingDescription
Use Current GroupYes (default) resolves the group from the post being viewed, which is what you want in a group template. No reveals the Group dropdown.
GroupPick a specific group. Shown only when Use Current Group is No.
Button TextThe button label. Default Leave Group.
Confirmation MessageThe 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 LeavingWhere to send the visitor after they leave. Leave empty to redirect to the LifterLMS Student Dashboard.
Not a Member MessageOptional 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

SettingDescription
ButtonTypography 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.