Speeding up WordPress / Manage Pages

Martin on January 24th, 2008

In one of my projects I am trying to use Wordpress as a CMS. It is working out fine, except for one annoying detail. I have written well over 200 pages of content now (not posts), and in the management interface the “Manage>Pages” page is becoming unbearably slow. In my particular situation it can take well over 35 seconds before it loads.

Time for a little hacking to find out what causes this delay. It turns out that the code for nicely displaying the pages in nested order is not exactly optimized.

The culprit is (mostly) the function page_rows() in /wp-admin/functions/template.php for Wordpress 2.3.2

It loops over all pages for each page to find out the parent-child relationship and this quickly becomes a time waste.

The following quick fix does not solve the inefficiency (the code needs to be rewritten), but it does speed things up quite a bit. By moving the function setup_postdata() out of the search loop a lot of needless initialization is avoided. See the code sample below on how to apply the fix:

/wp-admin/functions/template.php at around line 167:

Wordpress fix for slow manage pages admin page.

In my situation, the page loading time goes from 35 seconds down to now 4 seconds which is bearable, but not yet ideal. A better search routine should be able to completely reduce this wait.

Subscribe to this blog's RSS feed

Self Analysis with Google Analytics

Martin on January 22nd, 2008

There are many different ways to measure your blogs visitors. It is not only good for your ego but can also a be an indication of whether its time to upgrade your hosting or a measure of how to predict your advertising income.
One of the more traditional approaches is to run a nightly [...]

Continue Reading...

Setting your Blog on Fire with Feedburner

Martin on January 22nd, 2008

The first stones are in place, you are no longer looking at the default blue wordpress theme and your first blog entries shine on the front page. Or maybe you decided to skip of all this and got right to this point. Its a free world.
Now you need to promote your blog, and one [...]

Continue Reading...

What is in a domain name?

Martin on January 22nd, 2008

After I had figured out what I wanted to blog about — blogging tools and technologies — I needed to find a name for my blog.
So I came up with a name I really liked, and found out that the matching “.com” domain name was already registered.
I made a little list, and tried [...]

Continue Reading...

Permalinks - Looking Good

Martin on January 21st, 2008

If you have just installed Wordpress you will notice that every post you place on the Internet has a url looking a little like:

This works great but certainly is not too slick. So go to the “Options” tab in your Wordpress Dashboard, and then click on the “Permalinks” tab. Here you can modify how [...]

Continue Reading...

Akismet - Spam Gone!

Martin on January 21st, 2008

The first thing you will notice after putting your blog online (usually within an hour or so) is that spam isn’t limited to e-mail anymore. Wild hordes of software robots hunt the Internet for innocent blogs to deface.
Fortunately, Wordpress comes with a standard plugin that can put a significant dent into this. To activate [...]

Continue Reading...

Spicing up your blog with amazing pictures

Martin on January 21st, 2008

Yellow Yellow Yellow by vj_flicks
A blog isn’t just about text. A simple image can convey a feeling of depth to an article that it wouldn’t otherwise have. It is good for making your readers feel at home and comfortable while visiting your blog.
If you are writing a personal blog, images are simply life events [...]

Continue Reading...

Find an Internet Place To Call Your Own

Martin on January 21st, 2008

When I setup this blog, I did the most stupid thing possible. I didn’t do enough research, and I hadn’t really though out what I was intending to do.
So after only a little research, I plunked down a credit card and bought myself website hosting. Figuring that for once I wouldn’t put a website [...]

Continue Reading...

What do you blog about and why ?

Martin on January 21st, 2008

You can find a near endless number of blogs about personal finance, human rights, politics, computers,… , and of course blogging itself. Most important is to find a topic that stirs something and is guaranteed to keep you interested. I have many passions, but few compete with my interest in computers and software.
Over the [...]

Continue Reading...

Hello world!

Martin on January 15th, 2008

Everything has to have a beginning , and after some work this is the first post on BlogMechanics.
Over these past months I have read a lot of blogs which interested me. But the one thing that kept me most interested is in the plugins, themes and modifications that can be made to Wordpress and [...]

Continue Reading...