Last updated December 16, 2021

The Drupal community has defined a set of coding standards and best practices that you should adhere to whenever you're writing code for Drupal. These standards provide a set of rules for how your code should be formatted, and best practice guidelines for naming conventions and the location of files. This ensures consistency in code throughout the project and makes it easy for developers to move around from one sub-section to another without having to re-learn how to read the code.

Example tasks

  • Know where to find formatting standards for PHP, CSS, JavaScript and HTML in Drupal
  • Automate coding standards compliance for code
  • Properly use the t() function to make strings translatable in code


This is a well-defined area that does not tend to change quickly or dramatically. Resources labeled for Drupal 8 should apply to Drupal 9.

Drupalize.Me resources


More Guides

We have guides on many Drupal skills and topics.

Explore guides

External resources