I have a content type called slider as the image below shows:

enter image description here

I tried the following to export the content-type:

drupal config:export:content:type slider

when I enter the command, I am prompted to type a module name, which doesn't sound right.

Enter the module name [admin_toolbar]:

How can I export a specific content type using the drupal console?

2 Answers 2


Drupal console will create a new module for you and export the content type as configuration in new module under config folder. Eg. drupal config:export:content:type slider \ --module="new_module"


Drupal console config:export:content:type is to

Export a specific content type and their fields.

and required 4 arguments:

  1. --module : The Module name where config will exported.
  2. --optional-config : Export content type as an optional YAML configuration in your module.
  3. --remove-uuid : If set, the configuration will be exported without uuid key.
  4. --remove-config-hash If set, the configuration will be exported without the default site hash key.

So you can execute it like :

drupal config:export:content:type article \
--module="YOURMODULE" \
--optional-config -y \
--remove-uuid -n \
--remove-config-hash -y

-y to set value of argument to yes
-n to set value of argument to no

for more info check config:export:content:type documentation page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.