LifterLMS: Stop Search Engines Indexing Lessons and Quizzes
Adds a noindex instruction to LifterLMS lessons, quizzes and certificates, which are usually locked and only show crawlers a restriction message.
Opens WPIDE on
Code
if ( ! function_exists( 'llms_get_student' ) ) {
return;
}
add_filter( 'wp_robots', function ( $robots ) {
if ( is_singular( array( 'lesson', 'llms_quiz', 'llms_my_certificate', 'llms_certificate' ) ) ) {
$robots['noindex'] = true;
$robots['follow'] = true;
}
return $robots;
} );
Notes
Course and membership pages stay indexable.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.