How to disable Page Attributes dropdown in wp-admin

As discussed at WordPress admin screen very slow / timing out when editing or adding a new page/custom post

I am having a similar issue on a WP site containing 7,784 pages. Edit screens are slow loading due to the rendering of all 7k pages in the source code for the Page Attributes dropdown menu. Besides editing core, there must be a better way to deal with this. Seems like a flaw to render all pages on the edit screen.

Feedback from others with high volume/traffic WP sites much appreciated!

5 Answers
5

Removing support for page attributes will prevent that box from appearing…

function remove_page_attribute_support() {
    remove_post_type_support('page','page-attributes');
}
add_action( 'init', 'remove_page_attribute_support' );

… but I don’t know if you need attributes support or not. If you don’t that is the fix.

If you do, you will need to remove the box as per @KrzysiekDrozdz’s answer, but to be able to use those attributes you will have to rebuild that box, the original is here, in such a way that it works for you.

Leave a Comment