Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module prevents unpublished media files from being publicly accessible and indexed by search engines. It offers options to either add a prefix to file URLs or move files to a private directory. The module also provides a page to identify media used only in unpublished content.

The Deindex Unpublished Files module ensures that files associated with unpublished media are not publicly accessible. It achieves this either by adding a prefix to the file URL or by moving the file to the private files directory (private://unpublishedfiles), helping protect unpublished files from being exposed or indexed by search engines.

The module functions only with media types that include a file field.
It also provides a "Unpublish media by usage page" at /admin/content/deindex-unpublished-files/unpublished-media that lists media usage (unpublished nodes, published nodes, and other entities) to help identify items that should be unpublished. Rows highlighted in light red indicate media that is only used in unpublished content.

Installation

Place the deindex_unpublished_files module folder into modules/contrib.

Clear Drupal caches if necessary.

Visit the configuration form at:
Configuration → Media → Unpublished files settings (if the module is enabled).

Configuration

Choose the method to make unpublished media files inaccessible:

Prefix method: Adds a URL prefix to prevent access.

Private files method: Moves the file to a private directory (private://unpublishedfiles).

Activity

Total releases
12
First release
Sep 2025
Latest release
3 months ago
Releases (12 mo)
12 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.9 Stable Apr 9, 2026
1.0.8 Stable Apr 9, 2026
1.0.7 Stable Mar 6, 2026
1.0.6 Stable Nov 12, 2025
1.0.5 Stable Sep 26, 2025
1.0.4 Stable Sep 26, 2025
1.1.x-dev Dev Sep 25, 2025
1.0.3 Stable Sep 24, 2025
1.0.2 Stable Sep 24, 2025
1.0.1 Stable Sep 24, 2025
1.0.0 Stable Sep 24, 2025
1.0.x-dev Dev Sep 24, 2025