How to Send Learndash User to Custom Page After Completing the Course

Okay , your course user has completed the course and you as an admin may desire to show him automatically landing page for a new related course or wants to gift him a short course on some related topic or any other custom page . So do you do that ?

Step 1

Create a custom page and give a specific name ...say......custom-page “/custom-page”. 

Step 2

Then create Child Pages, one for each course and give each page the same slug as the course it is tied to. If You didn't do this, then the next step wouldn't work as coded.

Step 3

Find the LearnDash hook that fires when a LearnDash course completes. There is a learndash_course_completion_url   hook that let’s return a URL and the redirect happens automatically. Then 

Add This Code to Your Functions.php

<!--?php function custom_course_completed_redirect($link, $course_id) { $link = get_post_field( 'post_name', $course_id ); //You can change the link here return '/congrats/' . $link; } add_filter("learndash_course_completion_url", custom_course_completed_redirect, 5, 2); ?-->