Skip to main content
Home
Drupal life hacks

Main navigation

  • Drupal
  • React
  • WP
  • Contact
  • About
User account menu
  • Log in

Breadcrumb

  1. Home

What’s New in Drupal 11.3: YAML Content Export Built Into Core

By admin, 19 July, 2025

New in Drupal 11: Export Content to YAML with the content:export Command

 

With the release of Drupal 11.3.0, a powerful new tool has landed in core: the content:export Drush command. This feature simplifies how developers generate YAML-formatted content for installation recipes, testing, and automation pipelines.


Why You Should Care

Until now, creating YAML-based content recipes required third-party modules like Default Content, or time-consuming manual work. With content:export, this process is streamlined and integrated into Drupal core — no extra modules needed.


How to Use content:export

From your Drupal root directory, run:

php core/scripts/drupal content:export <ENTITY_TYPE_ID> <ENTITY_ID>

Example:

php core/scripts/drupal content:export node 123 > recipes/my_article.yml

This command exports the entity (in this case, a node) into a YAML file that’s immediately ready for use in recipes, automated tests, or migration setups.


What You Need to Know

  • Exports one entity at a time
  • Related dependencies (like attached images or taxonomy terms) are detected but not exported automatically
  • Core field types are supported. Custom field types may require integration code.
  • Entities can also be exported programmatically via the default_content.exporter service.

Extending Export Behavior

Need more control? You can hook into the PreExportEvent event to:

  • Skip specific fields from being exported
  • Provide custom export logic for custom field types
  • Include computed fields in the export

Example Use Cases

Exporting a taxonomy term:

php core/scripts/drupal content:export taxonomy_term 40 > taxonomy.yml

Programmatic export:

use Drupal\node\Entity\Node;
use Drupal\Core\DefaultContent\Exporter;

$node = Node::load(32);
$export = \Drupal::service(Exporter::class)->export($node);

Who Will Benefit?

  • Drupal developers building test fixtures or installation profiles
  • DevOps engineers automating content deployment
  • Distribution maintainers and module authors
  • QA teams writing reliable test suites

Final Thoughts

The content:export command is a welcome addition to the Drupal developer’s toolbox. It reduces manual work, improves testability, and brings content recipes closer to core best practices.

If you’re using Drupal 11.3.0 or later, give it a try and accelerate your content-driven development process.


🔗 Source: Drupal.org Change Record
🚀 Need help integrating content automation into your Drupal workflow? Contact our team of experts.

Tags

  • #Drupal Planet

Comments

About text formats

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Powered by Drupal