Advanced Custom Fields (ACF): Starter Guide
Advanced Custom Fields (ACF) is one of the most powerful and widely used plugins for extending WordPress. It lets you create custom fields, custom meta boxes, and structured content without writing a full custom plugin. Whether you’re building a custom post type, a dynamic landing page, or a client-friendly editing experience, ACF gives you complete control.
This starter guide introduces how ACF works, how to create field groups, and how to display field values inside your theme with clean code examples.
1. What ACF Does
ACF allows you to attach custom data fields to posts, pages, users, taxonomy terms, options pages, and more. Common use cases include:
- Custom hero sections
- Flexible content layouts
- Repeating blocks (FAQs, services, features)
- Custom meta for CPTs (events, products, listings)
- Options panels for global settings
Fields can be text, images, selects, repeaters, flexible content layouts, checkboxes, WYSIWYG editors — and dozens more.
2. Install ACF
- Go to Plugins → Add New
- Search for Advanced Custom Fields
- Install and activate
ACF Pro (paid) adds powerful fields like Repeaters, Flexible Content, Clones, and the Options Page. For many advanced builds, ACF Pro is worth it.
3. Create Your First Field Group
A Field Group contains one or more custom fields and controls where they appear in the WordPress admin.
Step-by-step
- Go to Custom Fields → Add New
- Give your field group a name (e.g., “Hero Section”)
- Click Add Field
- Choose a field type (Text, Image, Select, etc.)
- Set your Location Rules (e.g., “Show this field group if Post Type is Page”)
- Publish
Your custom fields now appear in the editor for the locations you selected.
4. Example: Basic Text & Image Fields
Let’s say you added:
- hero_title (Text field)
- hero_image (Image field)
You can now output them in your theme template:
Important: Always use escaping functions like esc_html() for safe output.
5. Example: Repeaters (ACF Pro)
Repeaters allow you to create flexible lists like FAQs or service blocks.
<div class="faqs">
<h3></h3>
<p></p>
</div>
This structure lets editors dynamically add unlimited entries.
6. Example: Options Page (ACF Pro)
Global settings like site-wide banners or contact info belong in an Options Page.
Add an Options Page
'Site Settings',
'menu_title' => 'Site Settings',
'menu_slug' => 'site-settings'
]);
}
?>
Output a field from the Options Page
7. Flexible Content (ACF Pro)
Flexible Content is a “page builder for developers” — ideal for creating custom block-like layouts without Gutenberg complexity.
Example layouts:
- Hero section
- Gallery
- Call-to-action block
Basic loop
<section class="hero">
<h1></h1>
</section>
<div class="cta">
</div>
This gives you full control over HTML, accessibility, schema, and performance — unlike many visual builders.
8. ACF + Custom Post Types
ACF shines when paired with CPTs such as:
- Events (date, venue, organizer)
- Portfolio items (gallery, client name, tools used)
- Listings (price, location, features)
Simply adjust your field group’s Location Rules to target the CPT:
“Show this field group if Post Type is Event”
9. ACF Blocks (for Gutenberg)
ACF Pro lets you register custom Gutenberg blocks using familiar PHP templates.
Register a block
'hero',
'title' => 'Hero Block',
'render_template' => 'blocks/hero.php',
]);
});
?>
This merges ACF’s flexible field editing with block-based workflows.
10. Best Practices
- Use esc_html(), esc_url(), esc_attr() when outputting fields.
- Use Options Pages for global site settings.
- Use Repeaters for dynamic lists.
- Use Flexible Content for creating custom page builder systems.
- Group related fields to reduce editor clutter.
Conclusion
ACF makes WordPress more powerful, flexible, and developer-friendly. Whether you’re extending custom post types, building reusable layouts, or giving clients structured editing tools, ACF is one of the most efficient ways to take WordPress beyond blogging.
This starter guide covered the essentials — field groups, repeaters, flexible content, options pages, and template usage. With these tools, you can build professional-grade WordPress experiences without needing a heavy page builder or complex custom plugins.
🔌 Looking for more? Check out our WordPress Plugins Hub to discover recommended tools and how to use them.