ACF
Advanced Custom Fields (ACF) is a WordPress plugin that allows us to define structured, predictable data without relying on rigid templates or unnecessary custom logic.
At Terra, ACF is the backbone of our backend architecture. It lets us model content in a way that is clear for editors, reliable for developers, and reusable in PHP.
What Is ACF?
Section titled “What Is ACF?”ACF extends WordPress by allowing developers to create custom fields and field groups that can be assigned to posts, pages, custom post types, taxonomies, and more.
Instead of storing content in free text or relying solely on WordPress’s default editor, ACF lets us define:
- Text, numbers, and rich content
- Media (images, videos, files)
- Structured data (Repeaters, Groups, Relationships)
- Configuration and settings fields
In short, ACF turns WordPress into a data-driven CMS, not a template-driven one.
Why We Use ACF
Section titled “Why We Use ACF”We use ACF because it fits perfectly with how we build projects at Terra.
Clear Data Models
Section titled “Clear Data Models”ACF allows us to define exactly what data exists, how it is structured, and how it should be used.
This removes ambiguity and makes our PHP code predictable and easy to maintain.
Editor-Friendly
Section titled “Editor-Friendly”Field groups are designed for content editors, not just developers.
Editors see only what they need, in the correct order, with clear labels and instructions.
Backend-Oriented
Section titled “Backend-Oriented”Our processes and functions expect structured data, not embedded HTML.
ACF provides clean arrays and values that can be easily processed in PHP and reused throughout the code.
Less Custom Code
Section titled “Less Custom Code”By using ACF’s built-in field types, we reduce the need for:
- Custom metaboxes
- Manual database queries
- Unnecessarily complex PHP logic
This keeps our backend simpler and easier to maintain.
How We Use ACF at Terra
Section titled “How We Use ACF at Terra”At Terra, ACF is not used randomly. We follow a consistent approach across all projects.
Field Groups as Data Contracts
Section titled “Field Groups as Data Contracts”Each ACF field group represents a data contract between the backend and the processes that consume it in PHP.
- Field names are stable and predictable
- Structure is agreed upon before implementing the consuming logic
- Changes are intentional and communicated
Design-Driven Data
Section titled “Design-Driven Data”We start from the design (Figma) and decide which data will be required for each module or component.
We create the corresponding ACF fields to capture that data in a structured way.
The frontend may initially use HTML with hardcoded data, and the backend then converts that content into dynamic data, feeding the variables from ACF.
Naming Conventions
Section titled “Naming Conventions”- Field names are lowercase and snake_case
- We are especially careful to make names descriptive, especially when the fields are not part of flexible modules
Read, Don’t Render
Section titled “Read, Don’t Render”ACF is used to provide data, not to render HTML.
- PHP retrieves data from ACF
- Logic and functions decide how to process it
- Markup remains independent from the data
What’s Next?
Section titled “What’s Next?”Now that you understand what ACF is and how we use it, the next step is seeing an example of using ACF fields consistently.
→ Continue to ACF Fields
Knowledge Check
Test your understanding of this section
Loading questions...