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.

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.4.tar.gz (6.6 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page