WordPress.org

Ready to get started?Download WordPress

Forums

Exclude Pages
Very slow performance on large site (1,500+ pages) (6 posts)

  1. coolbloke1324
    Member
    Posted 2 years ago #

    My site started to get VERY slow loading pages (4+ seconds per page) and I decided to run a PHP profiler on it to find out what was going on.

    After a lot of log digging I found that the PHP function in_array was being called tons of times and taking up over 50% of the load time of a page. When I looked at the call stack the origin was this plugin.

    Whilst it is VERY cool and great for smaller sites the performance hit you take on larger sites makes it unusable unless you have very aggressive caching enabled.

    Since I was only using it to exclude pages from the main header menu bar, I decided to take the HTML output generated and simply paste it as static code into the header.php so it is not generated every call.

    http://wordpress.org/extend/plugins/exclude-pages/

  2. kletskater
    Member
    Posted 2 years ago #

    Hi coolbloke1324,
    I am interested in how and what you did with the html output.
    isn't there a problem when updating WP to lose the code?
    which part html-code do I have to put in my header?

  3. kletskater
    Member
    Posted 2 years ago #

    exclude pages plugin takes 54% of al loading time here. So am over-interested in your solution.

  4. coolbloke1324
    Member
    Posted 2 years ago #

    Hi ya,

    I enabled the plugin, loaded the website, did View Source, then copied the specific section of the page where the menu bar was (inside a ul element) then turned off the plugin, edited my header.php file and pasted my static menu html overwriting the PHP-based menu output.

    This method only works well if you don't alter your pages regularly. If you don't then you can just add a new page manually into the header.php when you make a new page. This is the header.php file in your theme folder so changes are not lost when updating wordpress.

    If you do alter them a lot and would prefer to maintain the dynamic menu I would suggest you attempt to use a good caching system because loading the plugin just eats up processing time like anything!

  5. coolbloke1324
    Member
    Posted 2 years ago #

    P.S. if you are not familiar with editing wordpress themes, I'd read a few tutorials or make a copy of your current theme before altering it...

  6. kletskater
    Member
    Posted 2 years ago #

    thanks coolbloke
    thanks,
    I'm going to read into this matter before modifying the code.
    I do not much change to existing post and pages. but there will still be new pages and posts.
    What have you gain for speed?
    the loading of my site is now 957ms

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic