List More Custom Field Names | Scott Reilly | admin

List More Custom Field Names | Scott Reilly | admin,custom fields,edit page,edit post,meta

Description

By default, WordPress only allows 30 custom field names/keys to be listed in the dropdown selection ‘Name’ field when writing a post or page. If you, or the plugins you use, make use of a lot of custom field key names, you may surpass the default limit resulting in some custom field keys not being listed. This may force post authors to manually type in custom field key names if they aren’t listed, which increases the chances for naming errors (typos, or not using the precise key name that is needed). This may also cause some authors concern wondering where previously used custom field keys have gone since they aren’t listed.

This plugin increases the limit to 200 custom field key names.

There is no settings page to customize the default value. If you’d like to list some number of custom field key names other than 200 (say, for example, 100), you can do so in either of two ways:

  1. By editing your wp-config.php file and at the end adding a line such as:
    define( ‘CUSTOM_FIELD_NAMES_LIMIT’, 100 );
    -or-
  2. Somewhere — ideally in a mu-plugin or site-specific plugin, or less ideally your active theme’s functions.php file — hook the ‘c2c_list_more_custom_field_names’ filter and return the number you’d like to use:
    add_filter( ‘c2c_list_more_custom_field_names’, create_function( ‘$limit’, ‘return 100;’ ) );

Note: This plugin has no effect for users who make use of the block editor (aka Gutenberg) introduced in WordPress v5.0 because that editor does not directly expose custom fields in the interface.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Installation

  1. Install via the built-in WordPress plugin installer. Or download and unzip list-more-custom-field-names.zip inside the plugins directory for your site (typically wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
  3. (Optional) In wp-config.php, customize the number of custom fields you want shown. The default of 200 can be changed by adding a line like:
    define( ‘CUSTOM_FIELD_NAMES_LIMIT’, 100 );

Plugin author

Scott Reilly

Plugin official website address

https://wordpress.org/plugins/list-more-custom-field-names/
If you encounter problems in using the List More Custom Field Names plugin, you can comment below, and I will try my best to help you solve the problem

Leave a Comment

Your email address will not be published. Required fields are marked *