How to Auto Enroll Newly Registered Users into LifterLMS Membership

Using the function linked in that post within functions.php you can assign a membership to all new users created.

You just need to wrap it in the user_register Hook (https://developer.wordpress.org/reference/hooks/user_register/)

Fairly sure this is correct, slight modification of what I used as it was triggered from user XML import. Make sure to test in dev location.

// Assign Membership on user creation add_action( 'user_register', 'assign_membership_on_register', 10, 1 ); function assign_membership_on_register( $user_id ) { $membership_id = X; // Replace X with the post ID of the membership you wish to apply. llms_enroll_student( $user_id, $membership_id ); }

You would then set the Free courses as ‘auto enrolled’ for this membership and use the shortcode [course-list] or [lifterlms_courses mine=”enrolled”] (test which one works best as I had mixed results) to show only a grid of courses they are already enrolled in on their landing page.

Original source – https://wordpress.org/support/topic/membership-auto-enroll-for-new-registered-user/