How to Fix Custom Fields Not Showing in WordPress (Easy Guide)

How to Fix Custom Fields Not Showing in WordPress (2023 Guide)

Are you trying to add custom fields to your WordPress posts or pages, but can‘t find the "Custom Fields" box anywhere? You‘re not alone. Many WordPress users have encountered this issue, especially after recent updates to the platform.

In this in-depth guide, we‘ll explain what custom fields are, why they may not be showing up, and how you can easily restore access to this powerful WordPress feature. We‘ll also share some tips and best practices for working with custom fields effectively.

Let‘s get started!

What are WordPress custom fields?

Before we dive into troubleshooting, let‘s make sure we‘re on the same page about what custom fields are and why you might want to use them.

In WordPress, custom fields allow you to add extra metadata to your posts, pages, or custom post types beyond the standard fields like title, content, tags, etc. This metadata can be used to store all sorts of useful information, such as:

  • A specific layout or template to use when displaying the post
  • Price, SKU#, or other details for a product post
  • Latitude and longitude coordinates for a location
  • A mood or feeling associated with the post content
  • Any other data you want to attach!

Essentially, custom fields give you the flexibility to customize how your WordPress content is structured and displayed. Many WordPress themes and plugins rely on custom fields to enable their features.

Okay, so custom fields are pretty useful. Why aren‘t they showing up on your site? Let‘s troubleshoot…

Why custom fields may be missing in WordPress

Prior to WordPress version 5.0, the Custom Fields box appeared by default on the post and page editing screens for all new WordPress sites. However, with the introduction of the new Gutenberg block editor in WordPress 5.0, this behavior changed.

Since custom fields are considered an advanced feature that not all users will need, WordPress decided to hide the Custom Fields box by default to keep the interface cleaner and less cluttered. But don‘t worry – the feature is still there, and it only takes a few clicks to restore it.

It‘s also possible that a plugin you have installed, such as Advanced Custom Fields (ACF), may be set to remove the default custom fields box. We‘ll cover how to handle that scenario a bit later on.

How to enable custom fields in the WordPress block editor

To start using custom fields on your WordPress site, you‘ll first need to unhide the Custom Fields box in the post/page editor. Here‘s how to do it:

  1. Open up a post or page in the WordPress block editor, or create a new one.

  2. In the top right corner of the screen, click the three-dot icon to expand the settings menu.

  3. From the menu, click on "Preferences."

  4. In the Preferences panel, click on the "Panels" tab.

  5. Locate the "Custom Fields" option and toggle it on.

  6. WordPress will prompt you to confirm the change. Click "Enable & Reload."

After the page reloads, scroll down below the block editor and you should now see the Custom Fields box ready to use. WordPress will remember this setting, so the box will continue to appear whenever you edit posts or pages in the future.

Using the Custom Fields box, you can easily view, add, edit, or delete custom fields and their values for the current piece of content. Simply enter a name for the custom field, specify its value, and click "Add Custom Field."

Handling plugins that remove the custom fields box

In some cases, even after following the steps above, you may find that the Custom Fields option is missing entirely from the Preferences panel in the block editor.

If this happens, the most likely culprit is the Advanced Custom Fields (ACF) plugin. ACF is a popular tool that lets you define your own custom meta boxes and fields.

Starting in ACF version 5.5.13, the plugin includes a setting that removes the default WordPress Custom Fields box in order to improve loading performance, with the assumption that you‘ll be using ACF‘s features instead.

However, if you want to continue using the default custom fields alongside ACF, you can easily restore it by adding the following code snippet to your theme‘s functions.php file or via the Code Snippets plugin:

add_filter(‘acf/settings/remove_wp_meta_box‘, ‘__return_false‘);

This will ensure the Custom Fields box still appears even with ACF installed. Just be aware that any custom fields you add through this box won‘t be integrated with ACF‘s interface and configuration.

Alternative ways to add custom fields in WordPress

While the default Custom Fields box works well for basic needs, you may find yourself wanting a more user-friendly or powerful way of managing post metadata. Here are a few options to consider:

  • Use the Advanced Custom Fields plugin mentioned earlier, which lets you create custom meta boxes and fields tailored to your needs. ACF provides an intuitive interface for content editors to input custom field data.

  • Try the Pods or Toolset plugins, which offer similar custom field creation functionality to ACF but with some different design philosophies and approaches.

  • For simple text-based custom fields, the Simple Fields or Custom Field Suite plugins streamline the process of setting up and managing fields.

  • If you‘re comfortable with code, you can create your own custom meta boxes in your theme or plugin. The CMB2 library makes this easier with a set of helpful PHP functions.

Ultimately, the best approach depends on your specific requirements and development resources. But with the wealth of options available, you‘re sure to find a custom fields solution that fits your needs.

Tips for working with custom fields effectively

To wrap up, here are some tips and best practices to keep in mind when using custom fields on your WordPress site:

  • Choose clear, descriptive names for your custom fields to make their purpose obvious. For example, "event_date" is better than "ef1".

  • Be consistent in your naming conventions, such as always using underscores (event_date) or hyphens (event-date) to separate words.

  • Avoid storing sensitive information like passwords or API keys in custom fields, as these aren‘t encrypted by default. Use a plugin like CMB2 Snippets if you need to store encrypted data.

  • Remember that custom fields are specific to each individual post or page. If you need the same field to appear on every post, consider using a plugin like ACF that supports global field groups.

  • Use template tags like get_post_meta() to retrieve custom field values in your theme files. Make sure to include proper escaping and error checking.

  • If you‘re using custom fields to store data for front-end display, consider caching the output to improve performance, especially for complex or time-consuming operations.

By following these guidelines and choosing the right tools for your needs, you‘ll be able to harness the power of custom fields to take your WordPress content to the next level.

Conclusion

Custom fields are a valuable tool for adding structured metadata to your WordPress posts and pages. While they‘re hidden by default in newer versions of WordPress, it only takes a few clicks to restore access to the built-in Custom Fields box.

If you can‘t find the Custom Fields settings, a plugin like ACF may be overriding them; you can use a code snippet to unhide the default box if needed. For more advanced custom field needs, consider using dedicated plugins like ACF, Pods, or Toolset.

By understanding how to use custom fields effectively, you‘ll have much more flexibility in how your WordPress content is structured and displayed. We hope this guide has been helpful in troubleshooting any issues with custom fields and getting the most out of this powerful WordPress feature.

Did you like this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.