Posted on 8 Comments

Course Access Expiration is Here

WooCommerce Paid Courses 2.6.0 is hot off the press!

We’ve added the ability to set a time limit on courses using the new Access Period setting*. If you need to offer the type of courses that last only for a period of time, such as compliance training or continuing education, this feature is for you!

To get it set up, simply create a new course, or open an existing one, and use the Access Period panel in the sidebar:

New learners who enroll in the course will be notified via email when their access is set to expire soon, and will also see notices on the course frontend. They will automatically lose access when the date passes.

On the admin side, you’ll be able to see the expiry dates for all of your students right from the Learner Management table:

*The Access Period setting is only available in the block editor, not the classic editor.

Please see the full release change log for Sensei LMS.

To update, please head on over to Dashboard → Updates in the WordPress admin.

Please note: While we have thoroughly tested this release, it’s always possible that we’ve missed something. We recommend that you test the update on a staging site before updating your live site.

For Developers

New Filters – Sensei

  • sensei_user_courses_query – Filters the query which fetches the user courses. So it’s possible to introduce tabs with new content.
  • sensei_user_courses_filter_options – Filters the the user courses filter options (tabs).
  • sensei_render_view_results_block – Filter to render or not the view results block.
  • sensei_display_course_enrollment_actions – Filter to display or not the course enrolment actions.
  • sensei_admin_enrol_user – Notify when a user is manually enrolled to the course.
  • sensei_learners_learner_updated – Filter when a learner row is updated in learner management.

New Filters – WooCommerce Paid Courses

  • sensei_wc_paid_courses_expiration_remaining_days_notifications – Filters the remaining days to notify the user.
  • sensei_wc_paid_courses_expiration_notification_email_content – Filters the expiration email content, so the user can customize the text for the emails, or create new content for different remaining days notifications (in case they use the previous filter).
  • sensei_wc_paid_courses_expiration_notification_job_recurring_schedule – FIlters the schedule for the notifications, in case the user wants to send it at a different moment.
  • sensei_wc_paid_courses_expiration_before_email_content – Action to add any content before the expiration email.
  • sensei_wc_paid_courses_expiration_after_email_content – Action to add any content after the expiration email.
  • sensei_wc_paid_courses_expiration_countdown_notice_threshold – It allows users to configure when the notices will start to appear.
  • sensei_wc_paid_courses_expiration_job_recurring_schedule – Filter the course expiration job recurring schedule. The default value is "0 0 * * *" (daily at midnight). It doesn’t have additional arguments.
  • sensei_wc_paid_courses_learner_access_expiration_date – Filter the learner access expiration date. The filter arguments are:
    • {DateTimeImmutable} $expiration_date – Expiration date.
    • {DateTimeImmutable} $start_date – Start date.
    • {int} $user_id – User ID.
    • {int} $course_id– Course ID.

Deprecated Code

  • Sensei_WC_Paid_Courses\Courses::fix_product_metadata_type – No replacement.

8 thoughts on “Course Access Expiration is Here

  1. Mmmhh, great feature that we’ve been expected for a long time ;).
    Will there be any way to have some specificity for some users?

    Let’s say a user is enrolled in a course which has expired for him. Will we be able to set up a new expiry date just for him? If we can’t do that, what are his options to continue the course?


    1. Hey Bruno! Great question. We do have a feature in the works that will allow you to edit the expiry date for individual users. You can actually enable it now if you’d like, just keep in mind that it is unrefined, although quite functional 🙂

      To enable it, simply add the following code snippet and then view the Learner Management page for your course:

      add_filter( 'sensei_feature_flag_editable_course_expiration', '__return_true' );

      You will see a datepicker box in the “Access Expiration” column. You can tweak the expiration date for any user, and then click the “Update Learner” button on the right.

      Note that the UI will likely change soon, and hopefully will be a bit more intuitive 🙂

      1. Thanks a lot Alex, I’ll definitely give a try.

        This brings another question to me. Is the expiry date based on the first submitted lesson or based on the date of the order? In the second case, that would be a problem for a Wooccommerce product containing serveral courses for instance. Indeed, we have a product containing 6 courses.
        But course 2 starts only when course 1 is completed. In this case the calculation for the expiration date on course 2 should start after the 1st lesson of the course 2 has been “submitted”. Is that the case?


  2. interesting statement, that access expiration is available for new version 2.6. I have all updates installed, but still can see neither expiration in the course panel, nor within user list

    1. Hi,

      It’s in the Course sidebar when you’re editing a course. Do you have the sidebar enabled? If not, click on the gear in the upper right corner of the editor, ensure the Course tab is selected, and you’ll see the Access Period setting there.

      Otherwise, if you’re using the classic editor, please see this comment –

      1. Thanks for response.
        I am using classical editor, however in blogs I can switch between editors, here in courses I can’e How can I do that. Or that is a global switch in WordPress? that makes it totally unusable for me since I use a lot of custom widgets in JS.

  3. Hi,
    I am unable to find the course access period option. I am still using classic editor and LMS woocommerce latest version 3.13.3 .
    Am I missing something ?


    1. Hi Sanjay,

      As of Sensei 3.1, we no longer support the classic editor and are only building new features such as this for the block editor. That means if you want to take advantage of course expiration, you’d need to switch to using the block editor.

Leave a Reply

Your email address will not be published. Required fields are marked *