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.

Default Content

27,914 sites Security covered
View on drupal.org

This module allows you to include default content and configuration within your modules or install profiles. It exports content as YAML files, simplifying the process of setting up pre-defined data for your Drupal sites.

Overview

Default content gives your module and install profile a way to ship default content as well as configuration.

8.x-1.x is powered by core's serialization, rest and hal modules. The new 2.x version uses a custom normalization format that is optimized for the use case of default content.

Features

2.x

The 2.x branch is actively developed and has the following improvements over the 8.x-1.x version. The new version is however still experimental and might missing some 8.x-1.x features, specifically extensibility and integrations through hal+json normalizers.

  • A more compact YAML-based normalization format
  • Identifiers like ID, revision id, changed and revision timestamps and other fields are no longer exported
  • Built-in support for composite entities like paragraphs in a single file
  • User 0/1 are no longer exported but referenced by ID
  • Support for translations
  • Support for files (stored as files in the same folder as the normalized file enitties, filename must be unique)
  • Support for entity references in link fields
  • Improved support for path fields including the pathauto skip flag

Importing of hal_json based default content is still supported, but exporting can only be done in the new format. Support for the old format will be removed in a future version.

Important

8.x-1.x

Supports entity-references between content.
Supports files if you have File entity
Easily export your content and its dependencies to yml using drush commands.

How does it work

Enable default content first. Any module that requires default content can put YAML (hal+json for 8.x-1.x) versions of the entities inside content/{entity_type} folders.

For example see default_content_test which has

  • modules/default_content_test/content
  • modules/default_content_test/content/node
  • modules/default_content_test/content/node/imported.yml
  • modules/default_content_test/content/taxonomy_term
  • modules/default_content_test/content/taxonomy_term/tag.yml

Requirements

Core only.

Known problems

Please use the issue queue to file any issues you encounter.

Credits

Written by @larowlan in response to Snowman session by @eaton and @yoroy.

Similar projects

Looking for a D7 solution? Try here

Related modules

Activity

Total releases
1
First release
Jan 2026
Latest release
6 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
2.0.0-beta1 Pre-release Jan 12, 2026