Home / Blog / Development

ACF field names your future self won't hate

Naming is the part everyone rushes and everyone regrets. A small convention that makes a three-year-old build readable when you come back to it cold.

Advanced Custom Fields makes it easy to add fields quickly. That's exactly why so many projects end up with fields called text_1, image2 and new_title_final.

Here's the convention I use on every build.

Prefix by context

Start each field name with where it lives: hero_, project_, team_, opt_ for options pages. When you see project_client_country in a template three years later, you know exactly where it comes from.

Name the content, not the layout

hero_heading, not big_text_left. Layouts change in redesigns; the meaning of the content doesn't.

Be consistent with types

  • Booleans read as questions: project_is_featured, hero_has_video.
  • Repeaters are plural, their sub-fields singular: team_members → member_name, member_role.
  • Links end in _link, images in _image.

Write instructions for editors

Every field has an "Instructions" box. Use it: recommended image size, character limits, what happens if it's left empty. It costs seconds and saves support emails.

Save field groups as JSON

Enable local JSON so field groups live in the theme, under version control. Changes are trackable, and staging and production stay in sync.

Name fields for the developer who has never seen this site. Eventually, that's you.
Chat on WhatsApp