Browse: Home / Snippets /

Enroll new user into multiple courses on registration


Snippet #

Important: All snippets are provided as-is without support or guarantees. These snippets are provided as guidelines for advanced users looking to customize LearnDash. For any additional help or support with these snippets, we recommend reaching out to a LearnDash Expert.

add_action( 'user_register', function( $user_id ) {

	// Comma separated array of course IDs
	// Go here if you don't know how to find Course ID:
	$course_ids = [

	// Add user to each course
	foreach ( $course_ids as $course_id ) {
		ld_update_course_access( $user_id, $course_id, $remove = false );