Generating dummy Drupal content with Devel & more

10 Oct 2021

CMSs like Drupal offer website owners unlimited opportunities to add as much content as they need and when they need it. However, at the stage of website building, when developers and themers are creating layouts, Views, and other things that shape the content structure, there is often no content ready yet.

How to test everything well in various scenarios without content available? Developers or QA engineers are not editors — generating nodes for testing purposes can be a tedious task for them. Luckily, it is possible to “invite” an instant content generation assistant to your website. Just a few clicks will be needed for filling the site with as many dummy entities as needed.

This assistant is one of the favorite modules of Drupal developers — the Devel. In this post, we will take a tour of how to create dummy Drupal content with the Devel module, how to make the content as realistic as possible with yet another Devel-related module — the Realistic Dummy Content, and how to use Drush commands for the same purposes if you prefer the Drupal console.

Automatic dummy Drupal content generation

Introduction to the Devel Generate module

The Devel module has multiple missions in enhancing a developer’s workflows, content generation being just one of them. For this purpose, we will mostly need the Devel Generate module that the Devel module comes packed with.

The module generates entities based on their structure, field by field. For example, if there is an image field, it will add an image placeholder in the form of a colored block. The text will be generated in fake Latin that resembles a phrase familiar to many readers — “Lorem ipsum dolor sit amet…” widely used to substitute the real text.