{"id":18986,"date":"2016-09-22T11:00:19","date_gmt":"2016-09-22T16:00:19","guid":{"rendered":"https:\/\/getflywheel.com\/?p=18986"},"modified":"2025-03-11T14:07:00","modified_gmt":"2025-03-11T19:07:00","slug":"wordpress-custom-fields-how-to","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/","title":{"rendered":"How to Create and Use Custom Fields in WordPress"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Editor\u2019s note: This article was written by&nbsp;<a href=\"https:\/\/abbeyjfitzgerald.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Abbey Fitzgerald<\/a>,&nbsp;a UX software engineer and web designer who loves the art of crafting code.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress custom fields are a great way to expand upon the typical post or page content on your site. They are pieces of metadata that are attached to a post or page on your WordPress site, which means that by using this method, you are able to add additional information of any kind to your content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Organized in a key\/value format, custom fields are used for adding data across multiple posts or pages. The key is a name that provides consistency and identifies the specific field, such as \u201cItem.\u201d This is always the same. A value is the information that will be displayed in the field. The value will be different across posts, depending on what information is entered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we&#8217;ll cover all the most important information you need to know about adding custom fields to your WordPress site. Let&#8217;s dive in!<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Adding Custom Fields to WordPress Posts and Pages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following steps will show you how to use custom fields in your posts. If you would rather use them on pages, the same ideas will apply but will have to be implemented in template files that are responsible for building pages rather than posts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. First, click the three dots in the upper right corner of the post editor, and then click <strong>Preferences<\/strong> from the menu that appears. Next, click <strong>Panels<\/strong>, and then toggle on the <strong>Custom fields<\/strong> selector. Finally, click <strong>Show &amp; Reload Page<\/strong> to proceed.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"833\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences-1024x833.png\" alt=\"The Panels tab of the Preferences modal with Custom Fields toggled on.  How to Create and Use WordPress Custom Fields \" class=\"wp-image-147990\" style=\"object-fit:cover;width:710px;height:577px\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences-1024x833.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences-540x439.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences-768x625.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences-1536x1249.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences-1500x1220.png 1500w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/Custom-Fields-Preferences.png 1724w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. A Custom Fields section will now be shown in the post editor when you are editing posts.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/custom-fields-in-post.png\" alt=\"Add new custom field section. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19046\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s take a look at a very basic example of WordPress custom fields in action. Things will shape up with this example for a fitness blog. We\u2019ll use the custom fields to track and list various types of physical activity on posts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Add the key, which in this case is \u201cType of exercise.\u201d We will use this box to add specific details to the post.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Add the value. Let\u2019s go with Zumba for this one. Keep in mind, this is only going to show up on this specific post. On a different post, you can enter a different value, something like \u201cElliptical\u201d or another type of exercise.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/type-of-exercise-01.png\" alt=\"Type of exercise field. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19053\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5. Save the post.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this moment, you won\u2019t actually see much. You still need to add some formatting to display the information. So far, this additional information is stored in the database, so it can be called upon to be displayed. For this tutorial, I\u2019ve opted to display these custom fields on posts (instead of pages), so I\u2019ll go through the most basic way to format everything.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Displaying the Custom Fields on the Post<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using template modifications to add the custom fields as recurring site data is an efficient way of going about things. Let\u2019s say that you start by displaying the custom fields at the beginning of your post, but later decide that it would look better at the bottom. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By using template modifications, that change is easy to do because changing the template will update the entire site. If you didn\u2019t use this method, and instead saved the information individually inside each post, you\u2019d have to edit every single post to make the change, making changes much more difficult.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this example, the custom field will be shown before the post so the reader can see the exercise type right away before reading the entire post. To display it this way, the data will be called before the <a href=\"https:\/\/codex.wordpress.org\/The_Loop\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress loop<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: These customizations should be done in a <a href=\"https:\/\/wpengine.com\/resources\/how-to-create-a-wordpress-child-theme\/\" target=\"_blank\" rel=\"noreferrer noopener\">child theme<\/a> of course, and we\u2019ll be using the <code>single.php<\/code> file. As always, customizations like these are best tested in a development environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Open the <code>single.php<\/code> file and add this code after the header and before the WordPress loop:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;?php the_meta(); ?&gt;<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It will display something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/custom-field-1.jpg\" alt=\"text in image reads Type of exercise: Zumba. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19055\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019d rather have this displayed somewhere else on the page, try placing that snippet in the loop or after the loop. For example, by placing the function inside the <code>&lt;main&gt;<\/code> tag, the custom field information will be shown as part of the main content.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"primary\" class=\"content-area\"&gt;\n     &lt;main id=\"main\" class=\"site-main\" role=\"main\"&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This approach will also work to show other custom fields you have created.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing to mention about this example: The child theme was created from the WordPress Twenty Fifteen parent theme. If you\u2019re experimenting with where to display the custom fields, there may be other templates you need in your child theme besides the <code>single.php<\/code> file. To show the information in the post, a <code>content.php<\/code> was added to the child theme. The snippet above was placed within the content of the page so it appeared as part of the post.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/child-theme.png\" alt=\"themes &gt; cf-test &gt; internal files. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19044\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. Style the fields. If you go to the inspector, you\u2019ll see some new classes added to the page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s what the example looks like with the two different custom fields:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span class=\"post-meta-key\">Type of exercise:<\/span> Zumba<\/li>\n\n\n\n<li><span class=\"post-meta-key\">Time of day:<\/span> Morning<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s pretty simple to work with as a list. With some styling, it will look more integrated with the style of the site. With just a couple of simple CSS modifications, we can adjust the text color and list styling.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ul.post-meta li {\n     color: #898989;\n     list-style-type: none;\n     }\n\nul.post-meta li span.post-meta-key {\n     color: #1fc3d2;\n     font-weight: bold;\n     }\n\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/styled-custom.png\" alt=\"Custom styled text reads Exercise post title, Type of exercise: Zumba, Time of day: Morning, This is the exercise post. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19051\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">More Custom Fields Customizations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The styling in the previous example will work just fine, but there is more that we do. The following examples will show you how custom fields can be adjusted with additional display options for specific use cases. Making the custom field read as part of the post and setting the context with a helpful heading will be a great addition to the post. If you are following along step by step, be sure to comment out the <code>&lt;?php the_meta(); ?&gt;<\/code> that you added in the previous example.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this example, things have been slightly modified. The key has been simplified to \u201cexercises\u201d so it can be added to the template easier, and the code snippet was added in the content.php file of the child theme so it will appear in the post content, instead of before or after it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;?php $exercises = get_post_meta($post-&gt;ID, 'exercises', false); ?&gt;\n&lt;h3&gt;Today\u2019s exercise:&lt;\/h3&gt;\n&lt;ul&gt;\n&lt;?php foreach($exercises as $exercise) {\n     echo '&lt;li&gt;'.$exercise.'&lt;\/li&gt;';\n} ?&gt;\n&lt;\/ul&gt;<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The custom field is now shown below the heading that reads \u201cToday\u2019s exercise:\u201d in a list format. This has been set as an <code>&lt;h3&gt;<\/code> but can be easily adjusted to be another heading or paragraph style. If you do not want it in list format, that can also be structured however you\u2019d like.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/example-02.png\" alt=\"Text on image reads Today's exercise: Zumba. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19048\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conditional Custom <\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Fields<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There might be times where the custom field is not included. Say, for example, there\u2019s a post without an exercise value. This will allow you to display fallback information, so it\u2019s not just left blank.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php $exercises = get_post_meta($post-&gt;ID, 'exercises', true); ?&gt;\n\n&lt;h3&gt;Today\u2019s exercise:&lt;\/h3&gt;\n&lt;ul&gt;\n&lt;?php if ($exercises) { ?&gt;\n\n&lt;?php echo '&lt;li&gt;' .$exercises. '&lt;\/li&gt;'; ?&gt;\n\n&lt;?php } \/\/if there is nothing for exercises then display\n\nelse { ?&gt;\n\n&lt;li&gt;Today was a rest day.&lt;\/li&gt;\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/getflywheel-images.s3.us-east-2.amazonaws.com\/uploads\/2016\/09\/example-03.png\" alt=\"image text reads Today's exercise: Today was a rest day. How to Create and Use WordPress Custom Fields \" class=\"wp-image-19049\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The Advanced Custom Fields Plugin<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By following that tutorial, you can get custom fields up and running, but you have to do a lot of manual coding to make the editing of custom fields anything more than a text input for the field value. The fields we built in the tutorial are relatively simple. More complex fields naturally require even more coding. If you\u2019d rather use a plugin to add custom fields, however, there are options available.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.advancedcustomfields.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Advanced Custom Fields<\/strong><\/a> (ACF) is a <a href=\"https:\/\/www.advancedcustomfields.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">very popular<\/a> and flexible option, with more than <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/#field-types\/\" target=\"_blank\" rel=\"noreferrer noopener\">30 field types<\/a> to choose from.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Field Groups<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The field group editor is the heart of the Advanced Custom Fields plugin. Field groups are closely related to the above tutorial, as we essentially created a very basic version of a mini field group.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ACF field groups contain custom fields, location rules, and display options, as well as built-in controls for field validation, presentation, and conditional logic.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"861\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu-1024x861.png\" alt=\"Selecting a custom field with ACF's dropdown menu. The available fields are sorted into categories. How to Create and Use WordPress Custom Fields \" class=\"wp-image-147992\" style=\"width:710px\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu-1024x861.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu-540x454.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu-768x646.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu-1536x1292.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu-1500x1262.png 1500w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Field-Groups-Dropdown-Menu.png 1611w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Including fields in your field group is as simple as selecting them from the dropdown menu. The fields are sorted by category, and clicking <strong>Browse Fields <\/strong>opens a modal with descriptions of each field and links to documentation.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"635\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal-1024x635.png\" alt=\"The ACF Field Type Modal provides additional information on each field, as well as links to documentation. How to Create and Use WordPress Custom Fields \" class=\"wp-image-147993\" style=\"width:710px\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal-1024x635.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal-540x335.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal-768x476.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal-1536x952.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal-1500x930.png 1500w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2016\/09\/ACF-Field-Type-Modal.png 1867w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each field group uses&nbsp;location rules to display the fields when needed, exactly where you choose. Like the manual way of doing things, these display options allow you to customize your posts and pages&nbsp;however you\u2019d like, but all within the WordPress admin. ACF makes it simple to set even very complicated location rules with just a few clicks.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"378\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules-1024x378.png\" alt=\"The Location Rules tab for an ACF field group. Rules are set through dropdown menus and by combining and\/or statements. In this case, the rules are set to show the field group is Post type is equal to Post, and Taxonomy is equal to Exercise. How to Create and Use WordPress Custom Fields \" class=\"wp-image-147994\" style=\"width:710px\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules-1024x378.png 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules-540x199.png 540w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules-768x284.png 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules-1536x567.png 1536w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules-1500x554.png 1500w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2023\/11\/ACF-Location-Rules.png 1630w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/wordpress.org\/plugins\/advanced-custom-fields\/\" target=\"_blank\" rel=\"noreferrer noopener\">free version<\/a> of the ACF plugin gives you total control of how your WordPress site models content. All the basic field types you might expect: Text, URL, Image, etc.\u2013are present in ACF, along with numerous \u201cChoice\u201d fields such as <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/select\/\" target=\"_blank\" rel=\"noreferrer noopener\">Select<\/a> and <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/checkbox\/\" target=\"_blank\" rel=\"noreferrer noopener\">Checkbox<\/a>, jQuery fields like <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/date-time-picker\/\" target=\"_blank\" rel=\"noreferrer noopener\">Color Picker<\/a>, <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/date-time-picker\/\" target=\"_blank\" rel=\"noreferrer noopener\">Date Time Picker<\/a>, and <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/google-map\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Map<\/a>, and many more.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add in <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/conditional-logic\/\" target=\"_blank\" rel=\"noreferrer noopener\">bidirectional relationships<\/a>, easy-to-apply <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/conditional-logic\/\" target=\"_blank\" rel=\"noreferrer noopener\">conditional logic<\/a>, and WP REST API integration, and we\u2019ve still barely scratched the surface of what you can do when you <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/getting-started-with-acf\" target=\"_blank\" rel=\"noreferrer noopener\">get started<\/a> with the free version of this plugin.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Upgrading to ACF PRO gives you even greater capabilities. Build entire <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/how-to-create-an-options-page\/\" target=\"_blank\" rel=\"noreferrer noopener\">layouts in a theme<\/a> or <a href=\"https:\/\/www.advancedcustomfields.com\/blog\/rareloop-acf-case-study\/)\" target=\"_blank\" rel=\"noreferrer noopener\">create your own page builder<\/a> with the <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/flexible-content\/\" target=\"_blank\" rel=\"noreferrer noopener\">Flexible Content<\/a> field, use the <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/clone\/\" target=\"_blank\" rel=\"noreferrer noopener\">Clone<\/a> field to build <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/options-page\/\" target=\"_blank\" rel=\"noreferrer noopener\">reusable data structure components<\/a>, display images perfectly in <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/gallery\/\" target=\"_blank\" rel=\"noreferrer noopener\">sliders, carousels, and more<\/a> with the <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/gallery\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gallery<\/a> field, use the <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/repeater\/\" target=\"_blank\" rel=\"noreferrer noopener\">Repeater<\/a> field to <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/how-to-use-the-repeater-field\/\" target=\"_blank\" rel=\"noreferrer noopener\">wrap a theoretically unlimited number of subfields<\/a>, and give your content editors access to <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/options-page\/\" target=\"_blank\" rel=\"noreferrer noopener\">sitewide options and settings<\/a> with the <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/options-page\/\" target=\"_blank\" rel=\"noreferrer noopener\">Options Page UI<\/a>.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ACF PRO also includes <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/blocks\/\" target=\"_blank\" rel=\"noreferrer noopener\">ACF Blocks<\/a>, a powerful PHP framework for creating <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/create-your-first-acf-block\/\" target=\"_blank\" rel=\"noreferrer noopener\">fully customized and compatible WordPress blocks<\/a>.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Advanced Custom Fields with WP Engine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WP Engine is proud of our <a href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>world-class hosting for WordPress<\/strong><\/a> and the many developer tools and products we manage, including ACF! If you\u2019re looking for a hosting solution for your WordPress website, look no further than <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>WP Engine<\/strong><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Editor\u2019s note: This article was written by&nbsp;Abbey Fitzgerald,&nbsp;a UX software engineer and web designer who loves the art of crafting code. WordPress custom fields are a great way to expand upon the typical post or page content on your site. They are pieces of metadata that are attached to a post or page on your<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":154389,"template":"","resource-topic":[912],"resource-role":[896],"resource-type":[916],"class_list":["post-18986","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create and Use Custom Fields in WordPress<\/title>\n<meta name=\"description\" content=\"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let&#039;s look at how to use them properly.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create and Use Custom Fields in WordPress\" \/>\n<meta property=\"og:description\" content=\"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let&#039;s look at how to use them properly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-11T19:07:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/essentialpluginsheader.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Create and Use Custom Fields in WordPress\" \/>\n<meta name=\"twitter:description\" content=\"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let&#039;s look at how to use them properly.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/essentialpluginsheader.png\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/\",\"name\":\"How to Create and Use Custom Fields in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2016-09-22T16:00:19+00:00\",\"dateModified\":\"2025-03-11T19:07:00+00:00\",\"description\":\"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let's look at how to use them properly.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Create and Use Custom Fields in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085\",\"name\":\"WP Engine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"caption\":\"WP Engine\"},\"sameAs\":[\"https:\/\/wpengine.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create and Use Custom Fields in WordPress","description":"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let's look at how to use them properly.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"How to Create and Use Custom Fields in WordPress","og_description":"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let's look at how to use them properly.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2025-03-11T19:07:00+00:00","og_image":[{"width":1100,"height":500,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/essentialpluginsheader.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_title":"How to Create and Use Custom Fields in WordPress","twitter_description":"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let's look at how to use them properly.","twitter_image":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/essentialpluginsheader.png","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/","name":"How to Create and Use Custom Fields in WordPress","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2016-09-22T16:00:19+00:00","dateModified":"2025-03-11T19:07:00+00:00","description":"WordPress custom fields are a great way to expand upon the typical post or page content on your site. Let's look at how to use them properly.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-custom-fields-how-to\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"How to Create and Use Custom Fields in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085","name":"WP Engine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","caption":"WP Engine"},"sameAs":["https:\/\/wpengine.com"]}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2018\/08\/essentialpluginsgrid.png","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Developer","topic":"<strong>Topics:<\/strong> Performance","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/18986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/154389"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=18986"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=18986"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=18986"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=18986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}