Back to WordPress Glossary

What is a Custom Field in WordPress?

A custom field is a piece of metadata attached to a WordPress post, page, or custom post type to store extra information. Each custom field is a key/value pair: the key names the data (Mood) and the value holds it (Happy). Themes and plugins read custom fields to display that data on your site.

More About Custom Fields

Every custom field is stored as metadata: a key/value pair attached to a single piece of content in WordPress. The key is the field’s name, and the value is the information itself. You create a key once, reuse it on any post, and one key can hold several values on the same post.

Here’s the worked example from WordPress’s own documentation: the name (key) is “Currently Reading” and the value is “Calvin and Hobbes.” Finish the book, and your next post keeps the same key with a new value. An online store can reuse a “price” key the same way, with a value like “49” on every product.

Turning on the custom fields panel in the block editor

The block editor hides the custom fields panel by default if you haven’t used custom fields before. You turn it on in the editor’s preferences:

  1. Save your work first. WordPress reloads the editor to show the panel.
  2. Click the Options button (the three dots) in the top right-hand corner of your screen.
  3. Choose Preferences, then open the General tab.
  4. Turn on Custom fields in the Advanced section.
  5. Click the Select & Reload Page button.

The panel appears at the bottom of the edit screen. Click Enter new to type a field’s name, add its value, and save the pair with Add Custom Field. These steps apply to the block editor only.

Displaying custom fields on your site

Adding a custom field changes nothing your visitors see. On its own, the value never reaches the front end. Your theme has to output it with a template tag, such as the_meta(), which lists all of a post’s custom fields, or get_post_meta(), which retrieves a single one, or a plugin has to render it for you. A common failure mode is adding the field, viewing the post, and seeing no change because the theme or a plugin hasn’t been configured to display it. For the code and plugin walkthrough, follow our guide to adding custom fields to your WordPress posts.

Custom field vs. custom post type

The names sound alike, but they solve different problems:

  • A custom field adds extra data to a piece of content, like a price attached to one product.
  • A custom post type creates a new kind of content, like a Products section that sits alongside posts and pages.
  • The two combine: a Product custom post type can give every entry its own “price” custom field.

When to use a custom fields plugin

The built-in panel is enough for a few plain-text values you plan to output yourself. Reach for a dedicated custom fields plugin when you need typed fields such as dates or images, validation, repeatable groups, or an editing screen that non-developers can use safely. Pods and Meta Box are two options in the WordPress plugin directory, and searching “custom fields” there turns up plenty more. Decide who will edit the data before you install anything: if it’s only you, the panel plus a short theme snippet may be all you need.

Frequently Asked Questions

WordPress hides any custom field whose key starts with an underscore (_) from the panel and from the_meta() output. Plugins and themes use those protected keys to keep internal settings out of the list. Values stored as arrays stay hidden too, even without the underscore.
In the wp_postmeta database table, which holds metadata for pages, posts, and all other post types. Each field is a row with the post’s ID, the key, and the value. Comments and users have matching tables: wp_commentmeta and wp_usermeta.
No. The Preferences toggle only controls what the block editor shows you. Plugins and themes read and write post metadata directly whether the panel is visible or not, which is why a site can hold custom fields you never typed in.
Yes, through code: the metadata API accepts strings, numbers, arrays, and objects. WordPress serializes arrays and objects automatically, while scalar values such as integers are stored and retrieved as strings. The built-in panel is designed for text input, so richer values are usually set by a plugin or code.
Special Offer

Powerful WordPress Hosting

Reliable, lightning-fast hosting solutions specifically optimized for WordPress. Find the perfect plan for you by clicking below.

WordPress Hosting Plans