Skip to content
Web with Wordpress Logo
  • Home
  • Blogs
  • Pricing
  • About Us
  • Contact Us
Get a quote
Home / WordPress Development
WordPress Development

Block Bindings: Connecting Custom Fields to Core Blocks Without Custom Code

YuviNovember 14, 20267 min read
Block Bindings: Connecting Custom Fields to Core Blocks Without Custom Code

One of the long-standing frustrations with block themes was displaying custom field data. You might have a “price” field on a service, a “job title” field on a team member or an “event date” field on an event. In classic themes, you’d add a line of PHP to the template. In block themes, there was no simple way to place that value inside a paragraph or heading block. Developers had to build custom blocks just to display a single field.

The Block Bindings API, introduced in WordPress 6.5, changes that. It lets certain core blocks get their content from a data source instead of static text. You can bind a paragraph to a custom field, a heading to a computed value or an image to a URL stored in meta. The block displays the dynamic value, styled like any other block.

Here’s how block bindings work and how to use them.

What block bindings do

A binding connects a block attribute to a source. When the block renders, WordPress replaces the attribute’s value with the value from the source.

Core blocks and attributes that support bindings include:

  • Paragraph: content.
  • Heading: content.
  • Image: url, alt, title and id.
  • Button: url, text, linkTarget and rel.

Support has been expanding in later WordPress versions, so check the current documentation for the full list.

WordPress includes built-in sources, most importantly core/post-meta, which reads values from custom fields. You can also register your own sources.

A basic example

Imagine a custom post type for services, with a custom field called service_price. You want to display it in a paragraph on the single service template.

Step 1: Register the meta field

The field must be registered and available to the REST API, so the editor can work with it:

Fields that aren’t registered with show_in_rest won’t work with bindings. Protected meta keys, those starting with an underscore, need extra care, because they’re hidden from editing by default.

Step 2: Add the binding to a block

In the block markup, add a metadata attribute with the binding:

When this paragraph appears in a template or pattern, it displays the current post’s service_price value, wherever that template is used. The block can still be styled with the normal paragraph controls: typography, colours and spacing.

You can add this markup through the code editor, in template files of a block theme or in pattern files. Recent WordPress versions have also added interface support in the editor for viewing and managing bindings.

Step 3: Use it in templates

In a block theme, add the bound paragraph to the single template for the service post type, single-service.html. Each service page now shows its own price in a nicely styled paragraph, with no custom block or PHP template needed.

Binding images and buttons

Image bindings let a custom field supply an image URL and alt text:

Button bindings can supply a link and label, like a “Book now” button that links to a booking URL stored per service:

Registering custom binding sources

Sometimes the value you want isn’t stored directly in post meta. It might come from a calculation, a plugin’s data, a site option or an external system. You can register your own source with register_block_bindings_source:

Then bind a paragraph to it:

Now your phone number, opening hours and address can appear in headers, footers and contact sections across the site, all pulling from a single setting. Change the setting once, and every bound block updates.

Note the allowlist in the callback. Only return values you intend to expose, and escape them appropriately. Don’t create a source that lets anyone read arbitrary options.

Block bindings in patterns

Bindings work well in patterns. A “service details” pattern might include bound headings, paragraphs and buttons that display the current post’s fields. Editors insert the pattern into a template or post, and it fills itself with data.

Combined with pattern overrides, introduced in WordPress 6.6, bindings play a role in letting editors change specific content within synced patterns while keeping the structure consistent.

Why this matters

Block bindings reduce the need for custom blocks in many common scenarios:

  • Displaying custom field values in templates.
  • Showing site-wide information, like contact details, consistently.
  • Building data-driven layouts using only core blocks and patterns.

Fewer custom blocks means less JavaScript to build and maintain, and layouts that stay editable and stylable with standard block controls.

Limitations

Bindings are powerful, but they have limits:

  • Only certain blocks and attributes support bindings. Check the current list for your WordPress version.
  • Bound content is usually read-only in the editor unless the source supports editing. Editors may see the bound value but not edit it directly in the block, depending on version and source.
  • Complex formatting or logic, like formatting prices with currency symbols or conditional display, may need a custom source or a custom block.
  • Lists of items, like repeating fields, aren’t handled by simple bindings. Query loops, custom blocks or other approaches are needed.

For straightforward display of values, bindings are ideal. For complex interactive components, custom blocks remain the better tool.

Tips for using bindings

  • Register meta carefully with types and sanitisation callbacks.
  • Use clear field names and document them for your team.
  • Escape values in custom sources.
  • Provide fallbacks: decide what should display when a field is empty, and handle it in templates or sources.
  • Keep sources focused with allowlisted keys.
  • Test in the editor and on the front end, since behaviour can differ between WordPress versions.

A practical example from a client project

On a recent block theme project for a service business, each service had fields for price range, duration and a booking link. Previously, this would have meant a custom block or a classic PHP template. With block bindings, the single service template used ordinary heading, paragraph and button blocks bound to those fields. The designer styled them with the normal block controls, the client could adjust layout in the Site Editor and no custom JavaScript was needed.

We also registered a small custom source for business details, like phone number and opening hours, stored in a settings page. The header, footer and contact pattern all used bound paragraphs, so updating the phone number in one place changed it everywhere. Before bindings, that phone number had been typed manually in five different places, and it was out of date in two of them.

Planning fields for bindings

When planning custom fields for a block theme, think about how each value will be displayed. Simple text values, URLs and image references bind naturally. Values that need formatting, like prices with currency symbols, may be better stored already formatted for display, or exposed through a custom source that formats them. Planning this up front avoids awkward workarounds later.

Keep an eye on new versions

Block bindings are evolving quickly, with each WordPress release adding supported blocks, editor features and developer APIs. Before building complex workarounds, check whether a newer version already supports what you need.

Accessibility with bound content

Bound images still need meaningful alt text. Bind the alt attribute to a field or provide sensible defaults, rather than leaving images bound only by URL. Similarly, bound buttons should have descriptive text, not generic labels, so screen reader users understand where each button leads. Dynamic content deserves the same accessibility care as static content.

Know when to build a block instead

If you find yourself registering complex custom sources with lots of formatting logic, conditional output or nested data, a custom block may be cleaner. Bindings are best for simple, direct values; custom blocks remain the right tool for richer components.

Choose the simplest tool that does the job well.

Test your bindings after updates.

Frequently asked questions

Which WordPress version introduced block bindings?

WordPress 6.5 introduced the Block Bindings API, with improvements in later versions, including editor interface support.

Do block bindings work with ACF or other field plugins?

Values stored as standard post meta and registered with show_in_rest work with the core post meta source. Some field plugins provide their own integration or binding sources.

Can editors change bound values in the block?

It depends on the source and WordPress version. Often, bound values are shown read-only in the block, and edited through custom field interfaces instead.

Do I still need custom blocks?

For complex, interactive or highly formatted components, yes. For displaying field values inside standard blocks, bindings often remove the need.

Final thoughts

Block bindings close an important gap in block themes, letting core blocks display custom fields and other dynamic data. Register your meta with REST support, add bindings to paragraphs, headings, images and buttons in templates and patterns, create custom sources for site-wide or computed values and keep sources safe and focused. For many data-driven layouts, you’ll find you no longer need custom blocks at all.

block bindingsblock themescustom fieldsfull site editingpost meta

Post navigation

PreviousCreating Custom Database Tables in WordPress Plugins
NextInternationalising WordPress Plugins and Themes

Keep reading

WordPress Development

WordPress Playground: Instant Test Sites, Demos and Bug Reports in the Browser

November 15, 2026
WordPress Development

Curating the Block Editor for Clients: Fewer Options, Fewer Mistakes

November 15, 2026
WordPress Development

Plugin Upgrade Routines: Changing Your Database Safely Between Versions

November 15, 2026
Web with Wordpress Logo

We build, fix and grow WordPress websites, from first launch to ongoing care.

Quick links

  • Home
  • Blog
  • About Us
  • Contact Us

Topics

  • WordPress Development
  • SEO
  • WooCommerce
  • WordPress Security
  • Performance
  • Web Strategy

Contact

  • Haryana, India

© 2026 Web With WordPress. All rights reserved.

  • Privacy Policy