# Speed Up the Custom Fields Meta Box

> Skips the slow database query that fills the Custom Fields key dropdown, which can freeze the classic editor on sites with lots of post meta.

- Type: PHP
- Runs: Admin only
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, admin, database
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/speed-up-custom-fields-box/

## Code

```php
// Keys to offer in the dropdown. Leave empty to show a plain text field for the key.
$wpide_custom_field_keys = array();

add_filter( 'postmeta_form_keys', function ( $keys ) use ( $wpide_custom_field_keys ) {
    return null === $keys ? $wpide_custom_field_keys : $keys;
} );
```

## Notes

Existing custom fields on a post are still listed and editable.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Speed Up the Custom Fields Meta Box" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
