I'm new to the site but appreciate any help you can give.

I have a WordPress set-up which (rightly or wrongly) has hundreds of pages and thousands of another custom post type which is also based on a page (ie hierarchical).

When attempting to add a new page or custom post type (or edit an existing one) in the admin, the edit page screen loads extremely slowly if at all.

Usually timing out around the Attributes Box mark (sometimes it will load the entire page, sometimes not, but basically it's either extremely unusable or not usable at all).

My assumption is that because there is so many items to be loaded on the hierarchy menu (within the Attributes Box) it's causing the time out.

I understand that perhaps using so many pages in this way is perhaps not optimal for WP, but this is the situation the site is in now and I cannot easily change it (and unfortunately the ability to put a page within a certain hierarchy is needed so I can't just hide the Attributes box from the admin).

In the long run maybe the site needs to be rebuilt to use only posts however is there anything I can do for now to either help WordPress load the edit page fully and/or speed it up.

Any htaccess/php.ini hacks (I've tried a couple, like increasing memory size/execution time but didn't seem to help) or anything else you think I can try (I am open to nearly any idea), something in MYSQL to cache it maybe (I'm not an expert on this unfortunately)

Really appreciate any help you can give

Thanks, Nick

PS It's WordPress 3.2.1 PPS I also tried editing the permalink structure so it doesn't include %post-name but that didn't help PPPS I also tried duplicating the site and upgrading to WordPress 3.3 latest beta but still the same PPPPS The site is on a Rackspace Sites Cloud Server

Also... I tried disabling the Attributes box and just trying to use the Quick Edit function on the Pages listing part of the admin to control hierarchy but this is not responsive presumably because it is 'timing out' because of the same issue, so unfortunately my temporary workaround idea doesn't really do it either, cheers.


4 Answers 4


This may not help any, but it can't hurt to try it... Log into your server admin area, invoke the client interface for your database administration (e.g. phpMyAdmin), delete all the posts where their 'type' is marked as a revision, then compact the table.

If you have thousands of pages, you might also have millions of revisions slowing up your access.

  • It can't hurt, but it won't help either (at least not much). Problem lies in get_page_children function and not in revisions count - they are ignored in this query (of course they will slow MySQL down, but it won't be a big difference). Jul 11, 2013 at 17:02

The problem lies elsewhere a little bit. WordPress builds page hierarchy to fill post_parent select box. When there are many pages, this function can be a little bit slow (sometimes it is very slow).

So what can you do about it?

You can disable WordPress default page attributes meta box, using code below:

if (is_admin()) :
function my_remove_meta_boxes() {
    remove_meta_box('pageparentdiv', 'page', 'side');
add_action( 'admin_menu', 'my_remove_meta_boxes' );

If you need to set hierarchy of these pages (set post_parent for pages), you can still do it. Just add your custom meta box, and place there a select box with list of pages. You have to be sure, that your query (to select these pages) is more efficient though (list pages without hierarchy and select only title and page_id, or something like that).

PS. Look at WPs source code to see why it can be slow, when there are many pages... It uses get_pages with hierarchical argument set to true. It uses get_page_children then and it isn't very efficient function...


I had the same issue 5000+ pages, which made it take quite some time. The issue was Page Attributes which used wp_dropdown_pages -> loading all pages!

Since I still needed the possibility to use templates, only removing Page Attributes wasn't going to solve it.

And since I don't like to hack directly in core files, my solution was to remove then re-enable my own version of Page Attributes (taken from core files).

// Override of Page Attribute meta box
// This is because the load time of wp_dropdown_pages(), which is removed in our version.
// (original: page_attributes_meta_box() in wp-admin/includes/meta-boxes.php)

// Remove the original meta box
add_action( 'admin_menu', 'custom_remove_meta_box');
function custom_remove_meta_box(){
    remove_meta_box('pageparentdiv', 'page', 'side');

// Add our own meta box instead
add_action( 'add_meta_boxes', 'cuustom_add_meta_box');
function custom_add_meta_box() {
    add_meta_box('pageparentdiv', __('Page Attributes') , 'custom_page_attributes_meta_box', 'page', 'side');

// Use custom page attributes meta box, no need to load dropdown with pages!
function custom_page_attributes_meta_box($post) {
    if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) ) {
        $template = !empty($post->page_template) ? $post->page_template : false;
        <p><strong><?php _e('Template') ?></strong></p>
        <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label>
        <select name="page_template" id="page_template">
            <option value='default'><?php _e('Default Template'); ?></option>
            <?php page_template_dropdown($template); ?>
    <p><strong><?php _e('Order') ?></strong></p>
    <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
    <p><?php if ( 'page' == $post->post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>

In WP 3.5.1, to resolve this big problem (if you don't need often the attributes box) the best way is just not displaying the attributes box. To do this, comment lines 132 to 134 in wp-admin/edit-form-advanced.php. No attributes box displayed, no slow edit page.

  • 1
    Changing core files just to get this box out of your way is wrong. Unregister the box in a plugin instead. And please explain why that would help performance.
    – fuxia
    Mar 30, 2013 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.