Title: postmeta_form_limit
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘postmeta_form_limit’, int $limit )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#wp--skip-link--target)

Filters the number of custom fields to retrieve for the drop-down in the Custom 
Fields meta box.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#parameters)󠁿

 `$limit`int

Number of custom fields to retrieve. Default 30.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#source)󠁿

    ```php
    $limit = apply_filters( 'postmeta_form_limit', 30 );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/template.php#L718)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/template.php#L718-L718)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#related)󠁿

| Used by | Description | 
| [meta_form()](https://developer.wordpress.org/reference/functions/meta_form/)`wp-admin/includes/template.php` |

Prints the form in the Custom Fields meta box.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/?output_format=md#comment-content-1898)
 2.   [Muhammad Ismail](https://profiles.wordpress.org/warmarks/)  [  10 years ago  ](https://developer.wordpress.org/reference/hooks/postmeta_form_limit/#comment-1898)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpostmeta_form_limit%2F%23comment-1898)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpostmeta_form_limit%2F%23comment-1898)
 4. Current default limit is 30 keys shown in the dropdown. If you want to increase
    the limit.
 5.     ```php
        add_filter( 'postmeta_form_limit', function( $limit ) {
            return 50;
        } );
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpostmeta_form_limit%2F%3Freplytocom%3D1898%23feedback-editor-1898)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpostmeta_form_limit%2F)
before being able to contribute a note or feedback.