How to Add Custom User Account Fields in Grav CMS 2.0
Extending Grav 2.0 User Accounts with Custom Fields
Adding custom metadata like phone numbers, company names, or job titles to user profiles in Grav CMS is a common requirement. In Grav 2.0, user management relies primarily on Flex Objects by default. When custom fields added via blueprints fail to persist or render in the Admin panel, it is usually because Grav is referencing the Flex User blueprints rather than the legacy user account blueprints.
Here are two clear ways to add custom user fields in Grav 2.0: using a blueprint YAML override (recommended) or dynamically via a PHP plugin.
Method 1: Blueprint YAML Override (Recommended)
The simplest and cleanest way to add custom fields to user accounts in Grav 2.0 without writing custom PHP plugin code is by placing a blueprint extension directly inside your user configuration directory.
Depending on whether Flex Objects is enabled for accounts (default in Grav 1.7+ and 2.0), create one of the following files in your Grav installation:
For Flex User Accounts (Default in Grav 2.0)
Create the file user/blueprints/flex-objects/user-accounts.yaml and add your extended fields: