As an integral part of WordPress core functionality, custom fields are a familiar feature to most WordPress site owners. They are designed to help you flexibly change or expand the information of posts or pages.
By default, the custom fields option is hidden on the post edit screen. You can enable it via the WordPress built-in feature, or a custom fields plugin like WordPress Advanced Custom Fields (ACF). This freemium plugin is well suited for WordPress beginners with its user-friendly features.
What are WordPress custom fields?
Custom fields are a type of metadata that allows you to add additional information to specific pages or posts. The information can be text, images, numbers, or some calculations. However, these fields are not part of the post content but a separate field and are stored separately in the WordPress database.
Some components of a post such as author names, titles, reviews, product information, or disclosure statements are usually categorized and customized in custom fields.
One advantage of custom fields is that you can automatically display the available information in any page template wherever you need it. It’s time-saving and easy to enter data from custom fields instead of retyping everything from scratch. So if you want to change information, you can update it in one place instead of editing each individual post.
I’ll help you refine the grammar and clarity of this section while keeping as close to the original as possible:
How to Display Custom Fields in WordPress
WordPress does offer a native custom fields feature, but a plugin would make even better use of your custom fields. In this section, we’ll introduce you to two methods, including the manual method and the plugin method.
Manual Method
First, you need to activate the custom fields for all existing or new posts. Open a page or post and click on the three dots in the top right corner of the page. Scroll down and select Settings, then click Enable custom fields and reload in the Fields section.

Once you have reloaded the page, you will see a field for custom fields at the bottom of the editor.
In the Name column drop-down list, select an available custom field on your website or create a new one. Then enter the information you want to include in the custom fields in the Value field.

After creating fields, edit your themes to display them; otherwise, they will not be displayed in the frontend.
In your WordPress admin dashboard, go to Appearance > Theme File Editor. You may see a warning message warning you to be careful as you are directly accessing your website’s files there.
Locate the single.php file in the right sidebar to see the template for your blog posts. Open the file and look for the line /* Start the Loop */.
We are not going to edit this “loop” but add a new line of code at the end. At this stage, you can add any code you want WordPress to use to display your custom fields. Here is an example of a code snippet you can use:
<?php echo get_post_meta($post->ID, 'key', true); ?> <?php endwhile; // End of the loop. ?>
Don’t forget to replace the “key” value with the name of your custom fields created in the first step.
Honestly, the manual method doesn’t offer many options to customize your fields. That’s why we recommend you use the Advanced Custom Fields (ACF) plugin for advanced features.
How to use the Advanced Custom Fields plugin
Before you start, make sure you have installed and activated the ACF plugin on your website.
Once the plugin is successfully activated, navigate to Custom Fields > Add New in the admin console to start configuring your custom fields. Here you will find a section Add new field group. ACF calls it a “field group” as it is a collection of one or more custom fields that are displayed together in the post editor.
Simply name your field group and click Add fields to enter data. A big advantage of the ACF plugin is that you can choose what information you want to capture, e.g. text, number, email, password, URL, image, date picker, etc.

Another important thing to do is set location rules to determine where your field group should be attached. For example, if you want to display the custom fields only in posts, please specify that the post type is ” Post”. According to your setting, the field will be displayed in normal blog posts, not in pages or custom post types.

When you are done with the settings, remember to publish your field so that it can be displayed in the posts.
So, what do you do next? Just like with the manual method, you need to configure your themes to display the custom fields. If this is not done, they remain only in your website’s database.
If you choose to display custom fields in the frontend, your users will be able to sort or query information. However, this can be a disadvantage if you are running a membership site.
Imagine protecting private content with a password and setting up users’ emails as passwords. To make data entry easier, these emails are categorized in a custom field.
Regardless of how the content of your post is protected, the custom fields will still be visible. To solve this problem, take a look at the following section on how to hide your custom fields with the WordPress plugin Password Protect WordPress Pro (PPWP).
How to hide custom fields in WordPress
By default, the custom fields are still displayed in the frontend even though the posts are protected. To hide the fields generated by the Post Meta or ACF plugin, you simply need to add a conditional check to them using the default WordPress settings:
phpif ( post_password_required() ) {
echo get_the_password_form();
} else {
echo 'Password protected custom content';
}
This is the case if you want to hide entire custom fields in custom templates. You can also use the PPWP plugin to protect only part of the custom fields, not the entire field.
You can also use the PPWP plugin to protect content sections under custom page templates with passwords.
Conclusion
The Password Protect WordPress (PPWP) plugin is a powerful plugin that goes beyond the WordPress default settings to protect pages and posts whilst also protecting the content of custom fields.
Not only can you password protect the entire custom fields, but also parts of them. It’s worth noting that this feature is also available in the PPWP Lite version. Just give it a try and add another layer of security to your content.