core

Custom Field in WordPress

A custom field is a key-value pair attached to a WordPress post, page, or custom post type that stores additional metadata beyond the default title, content, and excerpt.

Custom Field

Who this is for: WordPress users building business sites, directories, real estate listings, or any site where standard post fields aren’t enough to describe your content.

A custom field is a key-value pair attached to a WordPress post, page, or custom post type that stores additional metadata beyond the default title, content, and excerpt.

Answer capsule: A custom field in WordPress is a metadata entry—a label and a value—that attaches extra data to any piece of content. For example, a property listing might store “bedrooms: 3” or “price: $450,000” as custom fields. WordPress saves these in the wp_postmeta database table and makes them available to themes and plugins via get_post_meta().


What Does a Custom Field Actually Store?

Custom fields store any data you need to associate with a post that doesn’t belong in the main content area. Common examples we see on client sites:

  • A real estate listing storing square footage, price, and number of bathrooms
  • A recipe post storing prep time, calories, and ingredient count
  • A product page storing SKU, weight, or warranty length
  • An event post storing venue address and ticket URL

Each custom field has two parts: a key (the label, e.g. event_date) and a value (the data, e.g. 2026-06-15). WordPress stores both in the wp_postmeta table, linked to the post by its ID.


Where Do Custom Fields Live in WordPress?

Custom fields have been part of WordPress core since version 1.2. In the block editor (Gutenberg), the default custom fields panel is hidden. To show it, open the post editor, click the three-dot menu in the top-right corner, select Preferences → Panels, and enable Custom fields. After saving, the panel appears below the editor.

The native interface works for simple use cases. For anything structured—repeating rows, image uploads, relationships between posts—the native UI becomes impractical fast.


Why Most Sites Use a Plugin for Custom Fields

The built-in custom fields panel shows a plain text input with no validation, no field types, and no display logic. In our testing across 200+ client sites, almost every site that relies on structured custom field data uses Advanced Custom Fields (ACF) or a similar plugin.

ACF (free tier on WordPress.org with 2+ million active installs) replaces the raw key-value interface with a field group builder that supports text, image, date picker, relationship, repeater, and more than 30 other field types. The Pro version ($49/year for 1 site) adds repeater fields and flexible content layouts—worth it the moment you need structured repeating data like a pricing table or team member list.

Other options in this space include Meta Box and Pods, but ACF is the one we reach for first on client projects because the field group UI is the fastest to hand off to non-technical clients.


Quick Example: Displaying a Custom Field in a Template

// Retrieve and display a custom field value
$price = get_post_meta( get_the_ID(), 'property_price', true );
if ( $price ) {
    echo '<p>Price: ' . esc_html( $price ) . '</p>';
}

This retrieves the value stored under the key property_price for the current post. The true parameter returns a single value rather than an array.


  • Custom Post Type — a content type beyond posts and pages; custom fields are most useful when paired with one
  • Post Meta — the underlying WordPress database concept; custom fields are post meta
  • Taxonomy — an alternative to custom fields when data is categorical and needs filtering
  • ACF (Advanced Custom Fields) — the most widely used plugin for managing custom fields

Additional reading:

Last verified: April 2026