When you lock a field, that field cannot be edited or deleted by any user using the Drupal user interface.
This is especially useful if you want to prevent anyone from accidentally deleting a field that is important to the site.
Locking a field involves 3 steps:
- Find the field storage configuration file. The file name follows the pattern of
field.storage.[ENTITY TYPE ID].[FIELD MACHINE NAME]
- Update the
locked
property totrue
- Import the configuration change
To unlock the field, repeat the process but set the locked
property to false
instead.
Tags