Skip to content

Instantly share code, notes, and snippets.

@davidmutero
Last active December 5, 2025 13:51
Show Gist options
  • Select an option

  • Save davidmutero/addc6d48f7d236f3e33b39669c3c133a to your computer and use it in GitHub Desktop.

Select an option

Save davidmutero/addc6d48f7d236f3e33b39669c3c133a to your computer and use it in GitHub Desktop.
Hide Course Overview from Non-Members Using the Default Courses Add On Module
<?php
/**
* Hide course overview from non-members
* when using the Default Courses Add On for Paid Memberships Pro.
*
* This prevents non-members from viewing detailed course content blocks
* such as Lesson Overview, Course Description, Requirements, etc.
*
* Add this recipe to your PMPro Customizations Plugin or use the
* Code Snippets plugin.
*
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
* Returning false prevents the Overview section from being displayed
* unless the viewer has access to the course via membership.
*/
add_filter( 'pmpro_courses_show_course_content_to_nonmembers', '__return_false' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment