Winner of the Best WordPress Business Website - WP Honors 2011
Since 2004
 

Forums

 

Manuals

 

Videos

 

Live Support

 

WPMU.org

Wordpress Admin issue: "Pages" and "Add New" Pages extremely slow

Elite

I have an major issue with a WordPress site of mine. In admin, when I try to do anything with pages ("Pages", "Add New", edit, etc) it takes forever to load (45 - 60 secs often).

I added "WP MySQL Profiler" plugin and for example when I try to access the add new page page it is showing "Total Queries: 5876 - Total Time Of MySQL Queries: 5.63461" which seems ridiculously high.

I have deactivated all plugins and changed themes with no luck. Used the "reinstall automatically" link to reinstall 3.0 but no luck. Any ideas?

My host has shut down account 3 times for eating up resources, need to fix it fast.

Thanks,
Bill

Everyday at WPMU DEV we help hundreds of WP Users. Become a member today to:

  • Download 250+ Premium Plugins and Themes
  • Get unlimited support from WordPress Experts
  • Get help with your WordPress or BuddyPress projects

Help & Support from WPMU DEV members and staff

Staff

Do you have caching set up? Have you checked the tables in the database to see if something might need to be repaired? Posts table or options table maybe? Did it start acting slow suddenly or was it a gradual thing? Just a few preliminary thoughts.

Elite

So, I think I have narrowed it down to an issue with permalinks. I noticed when I went to the permalinks settings page it was also extremely slow and it was doing a INSERT into the wp_options table for option name "rewrite_rules". This insert was massive as I think it included rewrite rules for every page on the site or something and it was probably looking all of these pages up individually, hence the massive amount of queries. This insert was also happening on the "Add page" and so probably the issue all around.

I switched permalinks from "%postname%" to "/%year%/%monthnum%/%postname%/" and now all seems corrected and the "rewrite_rules" option is much smaller. Tried switching back to old permalink structure and problem happened again.

Any ideas why? Not the end of the world if I have to keep new permalink structure because site is mainly based on pages and not posts, and page permalinks stay the same.

This site is a couple years old and problem started all of the sudden about 45 days ago out of the blue (before upgrading to 3.0).

Thanks for the help!

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Staff

How many pages do you have? That's really wierd you were getting all those queries on admin pages.

The previous way you had permalinks would cause performance problems if you have a lot of posts, because wp can't tell if someone is requesting a post or page.

Elite

Have about 600 pages and 150 posts... not a huge number.

http://www.gallerymar.com

I tried to switch back to "%postname%" permalinks and use "WP MySQL Profiler" plugin again to get the actual INSERT that it was making into "rewrite_rules" but now I can't even get that as it is running into a Fatal Error: Out of Memory before it can produce it.

Keeper of the Dark Chocolate

600 pages too high. Known wp bug for eons.

Staff

Ditto, and changing your post permalinks to be the same as pages just exponentially increases those performance problems. Can't find it now, but somewhere in the codex it explains more detail why.

Bottom line is there is not much that can be done until WP completely redesigns their permalink code, which will not happen any time soon.

EDIT
http://wordpress.org/support/topic/too-many-pages-custom-permalinks-fatal-error

Get personal, comprehensive and timely support and assistance
from WordPress Experts

Elite

Wow, I had no idea that 600 pages would be an issue.

So most of these pages are individual artwork pages. So... now with custom post types, if I created a "Artwork" post type and used that instead do you think that is the best solution? Or would I continue to run into issues? One problem with doing that is going to be changing the link structure of my whole site. As of now it goes http://www.gallerymar.com/artists/artist-name/artwork-name/ ... not sure I can make that work with custom post types, and even if I do make it work I might run into the same permalink issues because they are the same as before.

Any thoughts?

Thanks again!

Staff

Yes, you could do it with custom post types with a custom taxonomy, but I would just use normal posts with a custom artist taxonomy.

A lot of people abuse pages. They should ONLY be used for static content that doesn't need any kind of categorization/structure.

Keeper of the Dark Chocolate

Note we're talking about Pages as in not Posts. The urls of the Pages are stores within the database as a single array instead of each one stored individually like how the software handles Posts.

If there's anyway to move those Pages over to Posts and modify the permalinks, things would work a lot better.

If artists/artist-name/artwork-name/

maybe make artists the category, artist-name the subcategory and the artwork-name be the Post title and then change the custom permalinks to be

/%category%/%post%/

I think that would work.

We can help you out. Become a member today to:

  • Let our team help you out today and access to over 250+ Premium Plugins and Themes
  • Find out why people saying "it's like having your own developer"
  • WPMU DEV - The WordPress Experts