Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

What is: Custom Fields

Custom fields are a handy WordPress feature that lets you add information to your posts, pages, or custom post types.

By default, WordPress gives you fields to fill in the title, the main content of your post, and a featured image. But if you want to add extra information that WordPress doesn’t ask for, then you can use custom fields.

Many WordPress plugins and themes also use custom fields to store and display extra information on your WordPress website.

Glossary: Custom Fields

What Are WordPress Custom Fields Used For?

Custom fields can store extra information about a post, page, or custom post type that WordPress doesn’t allow by default.

For example, if you are writing a movie review, then you may want to add new details like the film’s release date, the director’s name, and the cast list.

Some plugins may also add custom fields in the WordPress content editor. For instance, All in One SEO (AIOSEO) uses them to let users fill in and store SEO metadata about the blog post.

WooCommerce also creates a custom post type for eCommerce products. It uses custom fields to store your product information.

Here are some other things you can do with custom fields:

A custom WordPress comment form example

How to Create a Custom Field in WordPress

To add custom fields, you need to open the Gutenberg editor for the post or page where you want to add the extra information.

Then, click the three-dot menu at the top-right corner of the screen and select ‘Preferences.’

Open preferences in content editor

A popup window will now appear. Here, just switch to the ‘Panels’ tab and toggle on the ‘Custom fields’ setting.

After that, click the ‘Enable & Reload’ button so that the block editor can refresh itself.

Enable custom fields option

If you scroll down the page or post edit screen, you will now see a new Custom Fields section.

You will see a dropdown menu where you can select an existing custom field added by WordPress themes or plugins. But if you want to create a new custom field meta box, then simply click ‘Enter new.’

View custom fields in WordPress

Now, just type down your custom field name and field value.

In our example, we named our custom field ‘Mood’, and the field data is ‘Happy.’ This is something you can do if you have a personal WordPress blog and want to tell users what mood you were in when writing the post.

Once done, just click on the ‘Add Custom Field’ button to save it.

Adding custom field name and value

From there, you can continue editing your content or updating it.

Another way you can create custom fields is to use the Secure Custom Fields or Meta Box plugins. These plugins give you more control and settings to manage your custom fields.

For example, you can create a field group that organizes related custom fields together, making it easier to manage them as a set.

Within this field group, you can define field types such as text, number, image, or even complex field types like repeater fields or flexible content layouts. This allows for a wide range of data input.

Pro Tip: If you can’t see the custom fields option in your WordPress preferences menu, then you may have the Secure Custom Fields plugin installed. It disables the default custom fields setting so that you can use the plugin instead. Please refer to our guide on how to fix custom fields not showing in WordPress for more information.

How to Display Custom Field Values in WordPress Posts or Pages

By default, WordPress doesn’t display the custom field values you’ve added on the front end of your WordPress site. To do so, you will need to add a custom code snippet to your WordPress theme file, specifically the single post template (single.php) file.

Advanced users can back up their website before making any code changes and then create a child theme, but this is not beginner-friendly.

Because of that, we recommend using WPCode, the best code snippet plugin on the market. Our WordPress custom fields 101 guide shows you how to display custom field values safely with WPCode.

We also have a tutorial on how to display specific posts only if they have certain custom fields. This conditional function be handy if you want to create a custom page that only lists those posts.

Where Are Custom Fields Stored in WordPress?

Custom fields in WordPress are stored as metadata, separate from the main content of your posts, pages, or other types of content.

When you create a new post, page, or any other type of content, WordPress organizes this information into two distinct sections.

The first section contains the actual content you input using the post editor. This is the text, images, and other media you add to your post or page.

The second section holds metadata, which includes details about the post, such as the title, author, and the date and time it was published. Metadata is not the main content itself but provides additional information about the post.

We hope this article helped you learn more about custom fields in WordPress. You may also want to see our Additional Reading list below for related articles on useful WordPress tips, tricks, and ideas.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Additional Reading

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!