Do you wish to discover ways to create customized meta containers on your WordPress posts, pages, and customized submit varieties?
WordPress provides metadata to your content material routinely, such because the publication date, classes, and tags. Nonetheless, you may additionally wish to add your individual customized meta information.
On this article, we are going to present you how you can simply add distinctive info to your content material, by making a customized meta information field in WordPress.
![How to add custom meta boxes in WordPress posts and post types How to add custom meta boxes in WordPress posts and post types](https://www.wpbeginner.com/wp-content/uploads/2017/06/how-to-add-custom-meta-boxes-in-wordpress-posts-and-post-types-og.png)
What’s a Customized Meta Field in WordPress?
While you create posts and pages, or customized submit varieties in WordPress, that content material normally has its personal metadata. This metadata is info associated to the content material like date and time, the writer title, title, and extra.
You may also add your individual metadata utilizing the default customized fields field.
![Adding custom meta boxes in WordPress posts Adding custom meta boxes in WordPress posts](https://www.wpbeginner.com/wp-content/uploads/2017/06/wordpress-custom-fields.png)
![Adding custom meta boxes in WordPress posts Adding custom meta boxes in WordPress posts](https://www.wpbeginner.com/wp-content/uploads/2017/06/wordpress-custom-fields.png)
Professional Tip: Can’t see the Customized Fields field within the submit editor? Then see our information on how you can repair customized fields not displaying in WordPress.
The Customized Fields field is an effective answer should you simply wish to add customized metadata to some posts. Nonetheless, should you plan so as to add a lot of distinctive info to your content material, then it is sensible to create a customized metadata field.
In reality, most of the well-liked WordPress plugins add customized meta containers to the Edit display screen for posts and pages. Within the following picture, you possibly can see how straightforward it’s so as to add search engine optimisation info to your submit, utilizing a customized meta field offered by AIOSEO.
![The All in One SEO (AIOSEO) WordPress plugin The All in One SEO (AIOSEO) WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/aioseo-seo-metadata.png)
![The All in One SEO (AIOSEO) WordPress plugin The All in One SEO (AIOSEO) WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/aioseo-seo-metadata.png)
With that being mentioned, let’s see how one can simply add customized meta containers in WordPress posts and submit varieties.
Find out how to Add Customized Meta Containers in WordPress Posts and Put up Varieties
The simplest means so as to add customized meta containers to WordPress is by utilizing Advanced Custom Fields. This plugin lets you connect all types of additional info to your posts and pages, after which present that information to guests utilizing a shortcode.
The very first thing it’s worthwhile to do is set up and activate the Superior Customized Fields plugin. For extra particulars, see our step-by-step information on how you can set up a WordPress plugin.
Create a Customized Meta Field
Upon activation, go to ACF » Subject Teams after which click on on the ‘Add New’ button.
![Adding a custom field to your WordPress website Adding a custom field to your WordPress website](https://www.wpbeginner.com/wp-content/uploads/2017/06/adding-field-group.png)
![Adding a custom field to your WordPress website Adding a custom field to your WordPress website](https://www.wpbeginner.com/wp-content/uploads/2017/06/adding-field-group.png)
Right here, you possibly can create the customized fields that may seem within the metadata field.
To start out, you’ll must kind a title into the sphere that reveals ‘Subject Group Title’ by default. It will seem within the WordPress content material editor, and it will likely be used because the title of your meta field.
With that being mentioned, it’s best to use one thing descriptive, particularly should you handle a multi-author WordPress weblog or share the dashboard with different folks.
![How to easily add custom meta data to your website or blog How to easily add custom meta data to your website or blog](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-field-wordpress.png)
![How to easily add custom meta data to your website or blog How to easily add custom meta data to your website or blog](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-field-wordpress.png)
With that performed, you’re prepared so as to add the primary subject to your meta field.
Add Customized Fields to the Meta Field
To start out, open the ‘Subject Sort’ dropdown and select the kind of subject you wish to add, reminiscent of Textual content, Date Picker, Checkbox, or another subject kind.
![Adding custom fields to the WordPress content editor Adding custom fields to the WordPress content editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-field-type.png)
![Adding custom fields to the WordPress content editor Adding custom fields to the WordPress content editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-field-type.png)
After that, kind in a label for the sphere.
Superior Customized Fields will present this label earlier than the sphere, so it is going to assist customers perceive what info they should enter.
![The Advanced Custom Fields WordPress plugin The Advanced Custom Fields WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-field-name.png)
![The Advanced Custom Fields WordPress plugin The Advanced Custom Fields WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-field-name.png)
Superior Customized Fields will generate the ‘Subject Title’ routinely, so you possibly can depart this subject empty.
With that performed, you could wish to kind in a ‘Default Worth.’ This shall be added to the web page, submit, or customized submit kind routinely if the person doesn’t add their very own info.
![Adding default values to custom WordPress fields Adding default values to custom WordPress fields](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metadata-default.png)
![Adding default values to custom WordPress fields Adding default values to custom WordPress fields](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metadata-default.png)
You might even see extra choices relying on the type of subject you’re creating. For instance, should you chosen ‘Picture’ from the ‘File Sort’ dropdown, then you possibly can select the picture format.
Most of those choices are self-explanatory so you possibly can comply with the onscreen directions to configure the customized subject.
While you’re proud of how the sphere is ready up, click on on ‘Shut Subject’ to break down the part.
![Adding custom data to a website or blog Adding custom data to a website or blog](https://www.wpbeginner.com/wp-content/uploads/2017/06/saving-metadata-settings.png)
![Adding custom data to a website or blog Adding custom data to a website or blog](https://www.wpbeginner.com/wp-content/uploads/2017/06/saving-metadata-settings.png)
Now you can add extra fields to the customized meta field by clicking on the ‘Add Subject’ button.
Then, merely configure the sphere by following the very same course of described above.
![Saving a custom field group Saving a custom field group](https://www.wpbeginner.com/wp-content/uploads/2017/06/add-fields-metadata.png)
![Saving a custom field group Saving a custom field group](https://www.wpbeginner.com/wp-content/uploads/2017/06/add-fields-metadata.png)
Add a Customized Meta Field to the WordPress Content material Editor
While you’re proud of how the customized meta field is ready up, you’ll must outline the place and when the meta field will seem.
Scroll to the ‘Settings’ part after which click on on the ‘Location Guidelines’ tab.
![Controlling where custom content appears in the WordPress content editor Controlling where custom content appears in the WordPress content editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/metadata-location-rules.png)
![Controlling where custom content appears in the WordPress content editor Controlling where custom content appears in the WordPress content editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/metadata-location-rules.png)
Superior Customized Fields can add the field to all types of content material. For instance, you possibly can present the meta field on particular submit varieties, classes, taxonomies, navigation menus, and extra.
Merely use the dropdown menus to decide on the place the meta field will seem in your WordPress dashboard. For instance, should you settle for visitor posts then you could wish to add the field to all posts within the ‘Visitor Posts’ class.
![Creating content rules using a WordPress plugin Creating content rules using a WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/field-group-rules.png)
![Creating content rules using a WordPress plugin Creating content rules using a WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/field-group-rules.png)
After that, click on on the ‘Presentation’ tab.
Right here, you possibly can select the meta field type, the place it seems in your WordPress weblog, and the place the label and directions will seem.
![ACF's presentation settings in the WordPress dashboard ACF's presentation settings in the WordPress dashboard](https://www.wpbeginner.com/wp-content/uploads/2017/06/metadata-presentation-settings.png)
![ACF's presentation settings in the WordPress dashboard ACF's presentation settings in the WordPress dashboard](https://www.wpbeginner.com/wp-content/uploads/2017/06/metadata-presentation-settings.png)
Should you plan so as to add a number of containers in the identical location, then you possibly can change the order they seem in by typing into the ‘Order No’ subject.
For instance, displaying an important meta containers in the direction of the highest of the display screen could enhance your editorial workflow.
Should you’re not sure, then you possibly can depart this subject set to 0.
![Reorganizing fields in the WordPress content editor Reorganizing fields in the WordPress content editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/metadata-order-reorganize.png)
![Reorganizing fields in the WordPress content editor Reorganizing fields in the WordPress content editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/metadata-order-reorganize.png)
On this display screen, you’ll additionally see an inventory of all of the fields that WordPress normally reveals on the submit edit display screen.
If you wish to conceal a subject, then merely test its field. For instance, should you’re utilizing customized fields to create an writer data field, then you could wish to conceal the default ‘Creator’ subject.
![Hiding fields in the WordPress post editor Hiding fields in the WordPress post editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/hiding-fields-metadata.png)
![Hiding fields in the WordPress post editor Hiding fields in the WordPress post editor](https://www.wpbeginner.com/wp-content/uploads/2017/06/hiding-fields-metadata.png)
While you’re proud of the adjustments you’ve made, click on on ‘Save Adjustments’ to make the sphere group stay.
You’ve now efficiently created a customized meta field on your WordPress submit, web page, or customized submit kind. Relying in your settings, now you can go to the submit editor to see the customized meta field in motion.
![An example of a custom meta data box, created using a free WordPress plugin An example of a custom meta data box, created using a free WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metdata-box.png)
![An example of a custom meta data box, created using a free WordPress plugin An example of a custom meta data box, created using a free WordPress plugin](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metdata-box.png)
Displaying Your Customized Meta Field Information in WordPress Theme
You’ve now efficiently added a customized meta field to the WordPress dashboard. Any info customers kind into the meta field shall be saved within the WordPress database once they save or publish the submit. Nonetheless, this info gained’t seem in your web site by default.
With that in thoughts, let’s make certain the customized metadata seems in your WordPress theme, so guests can see it.
You are able to do this utilizing shortcode or by enhancing your WordPress theme information.
Find out how to Show Customized Metadata utilizing Shortcode
Including a shortcode in WordPress is the simplest methodology, and lets you management precisely the place the data seems in your web site. For instance, should you’ve created a ‘Star Ranking’ subject, then you possibly can present this info after the submit title, contained in the content material, within the footer, or wherever else just by including a shortcode.
Nonetheless, you’ll need so as to add a shortcode to each web page, submit, or customized submit kind manually. This will take plenty of effort and time, particularly you probably have plenty of content material.
To get a subject’s shortcode, go to ACF » Subject Teams. Then, hover over the sphere group that you simply wish to show and click on on the ‘Edit’ hyperlink when it seems.
![Editing a meta data field group Editing a meta data field group](https://www.wpbeginner.com/wp-content/uploads/2017/06/editing-field-groups.png)
![Editing a meta data field group Editing a meta data field group](https://www.wpbeginner.com/wp-content/uploads/2017/06/editing-field-groups.png)
You’ll now see all of the fields that make up this group.
For every subject you wish to show, make a remark of the worth within the ‘Title’ subject.
![How to show custom data in your WordPress theme using shortcode How to show custom data in your WordPress theme using shortcode](https://www.wpbeginner.com/wp-content/uploads/2017/06/field-names-code.png)
![How to show custom data in your WordPress theme using shortcode How to show custom data in your WordPress theme using shortcode](https://www.wpbeginner.com/wp-content/uploads/2017/06/field-names-code.png)
With that performed, go to the web page, submit, or customized submit kind the place you wish to present the customized metadata.
Now you can click on on the ‘+’ icon and sort in ‘Shortcode.’
![Adding shortcode to a WordPress page or post Adding shortcode to a WordPress page or post](https://www.wpbeginner.com/wp-content/uploads/2017/06/adding-shortcode-wordpress.png)
![Adding shortcode to a WordPress page or post Adding shortcode to a WordPress page or post](https://www.wpbeginner.com/wp-content/uploads/2017/06/adding-shortcode-wordpress.png)
When the precise block seems, click on so as to add it to your format.
Now you can add the next shortcode to the block, ensuring to exchange "article_byline"
with the title of the sphere you wish to present.
![Adding custom meta data to a WordPress theme Adding custom meta data to a WordPress theme](https://www.wpbeginner.com/wp-content/uploads/2017/06/shortcode-custom-metadata.png)
![Adding custom meta data to a WordPress theme Adding custom meta data to a WordPress theme](https://www.wpbeginner.com/wp-content/uploads/2017/06/shortcode-custom-metadata.png)
Now you can repeat these steps so as to add a number of customized fields to the submit.
While you’re proud of the adjustments you’ve made, both click on on the ‘Publish’ or ‘Replace’ button. Now, merely go to your WordPress web site to see the customized metadata in motion.
![An example of custom meta data, displayed using a shortcode An example of custom meta data, displayed using a shortcode](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metadata-example.png)
![An example of custom meta data, displayed using a shortcode An example of custom meta data, displayed using a shortcode](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metadata-example.png)
Find out how to Show Customized Metadata by Enhancing Your WordPress Theme
If you wish to present customized metadata in the identical location on each web page, submit, or customized submit kind, then you possibly can add code to your WordPress theme information.
This will prevent time within the long-term, however it isn’t essentially the most beginner-friendly methodology. You’ll additionally lose all of the customized code the subsequent time you replace your WordPress theme, which is why we advocate creating a toddler theme. You’ll be able to then add your customized code to the kid.
Should you haven’t edited your theme information earlier than, then check out our newbie’s information on how you can copy and paste code in WordPress.
You’ll must edit the file the place you wish to present the customized metadata. It will range relying in your theme, however you’ll normally must edit your web site’s single.php, content material.php, or web page.php file.
After you have the precise file, you’ll want so as to add the code contained in the WordPress loop. To seek out this loop, merely seek for code that appears one thing like this:
<?php whereas ( have_posts() ) : the_post(); ?>
You’ll be able to then paste your code after this line and earlier than the road that ends the loop:
<?php endwhile; // finish of the loop. ?>
For example, your customized subject code ought to look one thing like this:
<h2 class="article-byline"><?php the_field('article_byline'); ?></h2>
Discover how we wrapped the code in a h2 heading with a CSS class. This permits us to format and magnificence the customized subject later by including customized CSS to our theme.
Right here’s one other instance:
<blockquote class="article-pullquote">
<?php the_field('article_pullquote'); ?>
</blockquote>
When including code to your theme, don’t neglect to exchange the sphere names.
With that performed, you possibly can go to any submit the place you’ve already entered information into the customized fields. You’ll now see your distinctive metadata in motion.
![How to add custom fields to a WordPress theme How to add custom fields to a WordPress theme](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metadata-author.png)
![How to add custom fields to a WordPress theme How to add custom fields to a WordPress theme](https://www.wpbeginner.com/wp-content/uploads/2017/06/custom-metadata-author.png)
We hope this text helped you discover ways to add customized meta containers in WordPress posts and submit varieties. You might also wish to see our information on how you can create automated workflows in WordPress, or see our knowledgeable choose of the most effective search engine optimisation plugins and instruments that it’s best to use.
Should you appreciated this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You may also discover us on Twitter and Facebook.
Leave a comment