Increase default number of fields in custom fields drop-down

The number of WordPress custom fields retrieved for the drop-down in the Custom Fields meta box is limited to 30. If you need to increases this limit you can use apply_filters and this simple function to change the limit. Place the following snippet within the functions.php of your WordPress theme to change the limit. Keep in mind although you can change the limit to anything the default is 30. So for each custom field metabox you have, the same dropdown is displayed so you may want to keep things to a reasonable number.

add_filter( 'postmeta_form_limit' , 'set_customfield_limit' );
function set_customfield_limit( $limit ) {
    $limit = 60;
    return $limit;

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!