Created
October 4, 2021 04:38
-
-
Save mitchellkrogza/edfc5dec07d636dbb2a09f01fbf077c8 to your computer and use it in GitHub Desktop.
FIX Slow WordPress Editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A fix for the horribly slow WordPress post and product editor | |
// With many thanks to Jon Brown | |
// Read about it at https://9seeds.com/wordpress-admin-post-editor-performance/ | |
/** | |
* Remove Ancient Custom Fields metabox from post editor | |
* because it uses a very slow query meta_key sort query | |
* so on sites with large postmeta tables it is super slow | |
* and is rarely useful anymore on any site | |
*/ | |
function s9_remove_post_custom_fields_metabox() { | |
foreach ( get_post_types( '', 'names' ) as $post_type ) { | |
remove_meta_box( 'postcustom' , $post_type , 'normal' ); | |
} | |
} | |
add_action( 'admin_menu' , 's9_remove_post_custom_fields_metabox' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment