Devel

Devel is a contributed Drupal module of debugging tools that developers install to inspect code and site internals while they build.

Learn DrupalDrupal glossary

Devel (drupal/devel) is a set of helper functions, blocks and pages for Drupal developers and curious administrators. It prints variables and database queries on screen, lists internals such as services, routes and events, and lets you switch to another user account. Its Devel Generate submodule fills a site with dummy content. The main module in release 5.5.0 supports Drupal 10.3, 11 and 12.

How Devel works in Drupal 11

Install it with Composer (composer require 'drupal/devel:^5.5') and enable it. Version 5.5 needs PHP 8.3 or later and cannot be installed next to Drush older than 13.7. It defines two restricted permissions: access devel information for the debug pages and switch users for logging in as someone else with one click.

The debug functions live in devel.module. dpm() prints a variable in the message area, dsm() is an alias kept for history, dpq() prints the SQL of a database query, and ddebug_backtrace() prints a backtrace.

The info pages are routes under /devel:

  • /devel/container/service and /devel/container/parameter list the registered services and parameters.
  • /devel/routes lists the routes, and /devel/events lists event listeners.
  • /devel/entity/info describes entity types, and /devel/state shows the State system.
  • /devel/switch-user is the Switch user page.

Settings are at /admin/config/development/devel. A mail-system class can write outgoing email to files instead of sending it. The Drush commands include fn-hook, fn-event, token, uuid and devel-services.

Devel Generate

The submodule creates sample content for development and testing. The Drush command devel-generate:content (alias genc) takes the number of nodes, 50 by default, and a --bundles option that defaults to page,article.

Example

To see what a form array holds, add this line to a form alter hook, reload the page and read the message area:

dpm($form);

To fill a development copy with 25 articles:

drush devel-generate:content 25 --bundles=article

Common mistakes

  • Running --kill on the wrong site. The option deletes all content before generating new content. Check which site Drush points at first.
  • Granting switch users to a non-developer role. Its holder can become any user on the site with one click, administrators included.

For marketing and content teams

You will meet Devel when a developer asks to test with a copy of the site filled with dummy articles, or when a staging site shows a block for switching to another user, so the team can see pages as an editor or a visitor would. Both belong on a development site or a staging site. Ask which environments have Devel enabled and which roles hold its permissions.

Sources

Questions about Devel

The Devel README says it is safe to use on a production site, provided the access devel information permission is granted only to developers. The project also includes tools that create or delete content, such as Devel Generate, so check which submodules are enabled.

Devel Generate is a submodule of the Devel project. Devel gives developers debug functions and info pages. Devel Generate creates dummy nodes, users, comments, taxonomy terms, media, menus and block content, from an admin form or with Drush.

Not in the 5.x line. The README says Kint support moved to the separate Kint module in July 2025. Devel itself sends output through its devel.dumper service and depends on the Symfony VarDumper component.

Related terms

All Drupal terms from A to Z