Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Speed Up Large WordPress & WooCommerce Website Back-End
add_filter( 'postmeta_form_limit', 'limit_postmeta_keys_to_zero', 10, 1 );
function limit_postmeta_keys_to_zero( $limit ) {
global $post;
// Only for these post types
$valid_post_types = array(
// WooCommerce Subscriptions
// WooCommerce
// Sensei
// WordPress
if( is_admin() ):
if( in_array( $post->post_type, $valid_post_types ) ) {
return 0;
return $limit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.