Title: large galleries
Last modified: August 24, 2016

---

# large galleries

 *  Resolved [Mike Zielonka](https://wordpress.org/support/users/mikezielonka/)
 * (@mikezielonka)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/large-galleries/)
 * We have a few large galleries and we are running out of memory on them. We can
   see it from this plugin.
 * Would that make any sense?
 * We are hosted on wp engine so we have some limits on execution time and what 
   not.
 * Mike
 * [https://wordpress.org/plugins/wp-gallery-custom-links/](https://wordpress.org/plugins/wp-gallery-custom-links/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990969)
 * WP Gallery Custom Links uses regular expressions to swap in the custom links,
   and regular expressions tend to be a little on the expensive side. Unfortunately,
   I’m not sure there’s a reliable way to keep all the same functionality without
   regular expressions – to my knowledge, WordPress doesn’t provide gallery hooks
   more specific than “large single chunk of HTML for the whole gallery” (ie no 
   hooks for individual images). If you or any other developer you know would like
   to review the code for suggestions on how to improve performance, I’m definitely
   open to ideas, as I know large galleries can cause issues. 🙂
 * Off the top of my head, the plugin loops over all possible image sizes looking
   for those urls to replace, and it may be possible to limit that to the setting
   on the gallery to remove some of those iterations, which I’ve been meaning to
   look into for a while and haven’t gotten around to yet. I’ll see if maybe I can
   make that modification in the next couple of days, and hopefully that may help
   you a bit, but the regexes in general are still probably the biggest issue.
 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990971)
 * Try version 1.10.3 that I just pushed out – I changed the default default target
   from “_self” to “do not change” to reduces the number of regexes it needs to 
   run on each item. Hopefully that should help at least a bit with performance.
 *  Thread Starter [Mike Zielonka](https://wordpress.org/support/users/mikezielonka/)
 * (@mikezielonka)
 * [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990973)
 * Thanks for the update. It’s super awesome of you to refactor it a bit for me.
 * I’ll push the update and run some memory tests early this week. 🙂
 * PS – Let me know how I can send you a coffee. 🙂
 *  Thread Starter [Mike Zielonka](https://wordpress.org/support/users/mikezielonka/)
 * (@mikezielonka)
 * [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990974)
 * the speed is way better!!!!!! down from 20secs to 1s on the query.
 * Thank you!!!
 * let me know how I can send you a coffee. 🙂
 * Feel free to tweet me [@mikezielonka](https://wordpress.org/support/users/mikezielonka/)
 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990977)
 * No coffee necessary 🙂 But if you do feel inclined to donate anyway, there’s 
   a button on this page:
 * [http://fourlightsweb.com/portfolio/wp-gallery-custom-links-plugin](http://fourlightsweb.com/portfolio/wp-gallery-custom-links-plugin)
 *  Thread Starter [Mike Zielonka](https://wordpress.org/support/users/mikezielonka/)
 * (@mikezielonka)
 * [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990985)
 * Then maybe sone ice cream. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘large galleries’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-gallery-custom-links_d3d5d9.svg)
 * [WP Gallery Custom Links](https://wordpress.org/plugins/wp-gallery-custom-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-gallery-custom-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-gallery-custom-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-gallery-custom-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-gallery-custom-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-gallery-custom-links/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Mike Zielonka](https://wordpress.org/support/users/mikezielonka/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/large-galleries/#post-5990985)
 * Status: resolved