Skip to main content

A mkdocs plugin that lets you exclude selected files or sections from the search index.

Project description


A mkdocs plugin that lets you exclude selected files or sections from the search index.

If you only need to exclude a few pages or sections, mkdocs-material now introduced built-in search exclusion! The mkdocs-exclude-search plugin complements this with more configuration options (wildcard exclusions, ignoring excluded subsections). It also provides search-exclusion functionality to regular mkdocs users.

PyPI - Downloads


Install the plugin using pip:

pip install mkdocs-exclude-search

Activate the search and exclude-search plugins in mkdocs.yml. search is required, otherwise exclude-search has no effect!

  - search
  - exclude-search

More information about plugins in the MkDocs documentation.


  • List the markdown files to be excluded under exclude using the format <path>/<to>/ in the docs folder.
  • Exclude specific heading subsections using the format <path>/<to>/ Chapter names are all lowercase, - as separator, no spaces.
  • Exclude all markdown files within a directory (and its children) with dirname/*.
  • Exclude all markdown files with a specific name within all subdirectories with dirname/*/ or /*/
  • To still include a subsection of an excluded file, list the subsection heading under ignore using the format <path>/<to>/
  • To exclude all unreferenced files (markdown files not listed in mkdocs.yml nav section), use exclude_unreferenced: true. Default false.
  - search
  - exclude-search:
        - dir/
        - dir2/*
        - /*/
        - dir/
      exclude_unreferenced: true
    - Home:
    - First chapter:
    - Second chapter: dir/
    - Third chapter:
    - Fourth chapter: dir2/
    - Fifth chapter: subdir/

This example would exclude:

  • the first chapter.
  • the second chapter (but still include its some-heading section).
  • the some-heading section of the third chapter.
  • all markdown files within dir2 (and its children directories).
  • all markdown files named within all subdirectories.
  • all unreferenced files

See Also

More information about templates here.

More information about blocks here.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-exclude-search-0.6.5.tar.gz (7.1 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page