Chapter Progress
0% Complete

HOW TO REMOVE ‘MARK COMPLETED BUTTON’ FROM LEARNDASH FOR FREE?

1. Open the ‘Dashboard‘.

2. Click on ‘Plugins‘ – ‘Add new‘.

3. In the Search Field, type: ‘My Custom Functions‘ followed by ‘Enter’.

5. Install the Plugin ‘My custom functions‘ by Space-X-Chimp.

6. Activate the Plugin ‘My Custom Functions‘.

7. Go back to the ‘Dashboard’.

8. Click on ‘Settings‘ – ‘PHP Inserter‘.

9. Enter the code below in the ‘Functions (PHP Code)‘ Box.

// Autocomplete function hookup
add_action("wp", "custom_learndash_automatically_mark_complete");
//function for Mark Complete Button Removal
function custom_learndash_automatically_mark_complete() { 
  global $post, $current_user; 
  $excluded_courses = array(1234, 5674, 6785);

  $course_id = learndash_get_course_id(); 
  if(empty($course_id) || in_array($course_id, $excluded_courses)) 
    return;

  if( !empty($current_user->ID) u0026amp;u0026amp; !empty($post->post_type) u0026amp;u0026amp; $post->post_type == "sfwd-lessons") { 
    learndash_process_mark_complete($current_user->ID, $post->ID); 
  }

  if( !empty($current_user->ID) u0026amp;u0026amp; !empty($post->post_type) u0026amp;u0026amp; $post->post_type == "sfwd-topic") { 
    learndash_process_mark_complete($current_user->ID, $post->ID); 
  }
}

10. Click on ‘Save Changes‘ and make sure the ‘On button‘ is turned on (you’ll find the button in the top-right-corner). 

Scroll to Top