WordPress MU Write Post page opens very slow

After finishing an upgrade from WordPress 2.7 to WordPress 2.6.5 my “Write Post” page would take very long (2 or 3 minutes) to completley load. The “Custom Fields” records where full of entries, some 500 or 600. I deleted all those entries manually and now my “Write Post” page would load within about half a minute or so. This was still very slow, so I did some Googeling on this Issue.

Since I was using Google Chrome I didn’t get any error messages. Using Mozilla Firefox I got this error message:

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script:http://ralfengel.com/wp-includes/js/jquery/jquery.js?ver=1.2.6:11″

The slow loading of the “Write Post” page in WordPress MU is caused by the execution of a script which loads all the meta data of all the posts (wp_postmeta). I believe that my dirty install (I imported allmost 400 posts with comments from my old WP installation) caused this. I had to repeat the upload several times for each file part (can’t upload (import) 4 mega bites using the import function of WordPress, thus I broke it up into 4 parts), since the uploads wouldn’t complete correctley.

There are two ways to fix the problem. You can either edit your edit-form-advanced.php file in the wp-admin folder or you can do a clean up in your database by running a query.

Edit the edit-form-advanced.php
Open the edit-form-advanced.php file found in wp-admin folder in an html editor and navigate to line 306 (for WPMU 2.6.5). You will see the following code there:

<?php
$metadata = has_meta($post->ID);
list_meta($metadata);
?>

You will have to delete this code. Save the file and upload it to your wp-admin folder. Refresh your “Write Post” screen. It should load within the usual 3 seconds. That is all, you’re done.

2. Clean up the WordPress Database using a query
To do a Database cleanup you will have to log in to your MySQL Database on your Server.
Once you are in PHP my Admin you should see your database name on top left and below all the tables it contains.
On the top of the right big window you should see a “SQL” tab. Click on it. Now paste the following code into the “execute query” window.

DELETE FROM wp_1_postmeta WHERE post_id =0;

DELETE FROM is the command line. wp_1_postmeta is the table name in MY database. You will have to change this to the name of your postmeta record name. This could be wp_postmeta or wp1_postmeta or something like it.
Hit the “execute query” button. You should get a report stating how many records where deleted. In my case there were some 3500 records with post_id=0.
After refreshing your “Write Post” window, you should get the page loaded in the usual 1-3 seconds.

Incoming search terms:

No related posts.

Tags: MU Bugs, MU trouble, Script busy, Script Error, Write Post Slow

6 Responses to “WordPress MU Write Post page opens very slow”

  1. Hello!
    Very Interesting post! Thank you for such interesting resource!
    PS: Sorry for my bad english, I’v just started to learn this language ;)
    See you!
    Your, Raiul Baztepo

  2. I have similar issue with my wp 2.8 (not mu). You see the site jiltin.com is fast in query, but very slow when I tried to edit or new post. I have tuned the mysql, php and the apache. In fact, this has made my blog faster in query, but very slow in edit port or new post. I have enough memory 12 GB with quad core poweredge system. Can also guide me what others areas to look into? Thanks in advance, Jiltin

  3. [...] ??????POST????????? [...]

  4. I am not using MU but had had this problem for months. Thanks for your suggested solution. I used the second way and the problem is solved.

  5. Oh!! thanks you very much!! I had the same issue. When i click in “new post”, that goes very slow. IT TOOKS AGES!!

    I just did the 2Âş step:

    DELETE FROM wp_1_postmeta WHERE post_id =0;

    Thanks you very much, now my website loads much faster!!

  6. i would prefer Infolinks over Kontera because they pay much better.*-.

Leave a Reply