Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
It might be related to this wp core bug which many seem to have a problem with core.trac.wordpress.org/ticket/10964 –  Jens Wedin Nov 20 '11 at 13:22
    
There's an ongoing discussion on WordPress here: http://wordpress.org/support/topic/wp-admin-even-33-incredibly-slow?replies=18#‌​post-2505352 –  Roger Dec 16 '11 at 17:32
add comment

3 Answers

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.

share|improve this answer
    
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). –  Krzysiek Dróżdż Jul 11 '13 at 17:02
add comment

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' );
endif;

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...

share|improve this answer
add comment

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.

share|improve this answer
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. –  toscho Mar 30 '13 at 19:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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