# 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.

- Type: PHP
- Runs: Frontend only
- Category: [Courses & Community](https://wpide.com/library/category/learning/)
- Tags: lifterlms, seo, noindex
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/lifterlms-noindex-lessons/

## Code

```php
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 use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "LifterLMS: Stop Search Engines Indexing Lessons and Quizzes" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
