Title: Memory issues
Last modified: August 30, 2016

---

# Memory issues

 *  Resolved [Bryan Willis](https://wordpress.org/support/users/codecandid/)
 * (@codecandid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/)
 * I created a post that had a lot of words (1000+) in it and tried previewing it
   and got this error about memory:
 * [http://disputebills.com/site/uploads/2015/06/Screen-Shot-2015-06-24-at-9.32.56-PM.png](http://disputebills.com/site/uploads/2015/06/Screen-Shot-2015-06-24-at-9.32.56-PM.png)
 * I had a lot of plugins installed and tried uninstalling them individually. It
   ended up being custom content shortcode that was causing the memory issue. I 
   disabled all other plugins and was still getting the issue. All I had was genesis
   theme installed.
 * I use this plugin for most sites I build on wpengine and have never had any issues
   because their caching and server is so well built.
 * I know I could fix the issue by changing the php.ini memory limit, but that doesn’t
   seem like the right fix here. I only say that because at the time I didn’t have
   any shortcodes being used on the site.
 * Anyway, just wanted to post and see if anyone else was having issues with huge
   posts.
 * The page that this happened on is here:
 * [http://disputebills.com/cutting-high-medical-costs-if-youre-uninsured/](http://disputebills.com/cutting-high-medical-costs-if-youre-uninsured/)
 * I disabled the plugin so it now works.
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

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

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270290)
 * Thank you for posting about the issue. It’s the first time to hear about it –
   there were a couple of people who mentioned that having a large number of posts(
   ~5000, I think it was) slowed down the queries/page load, but that’s true in 
   general.
 * > ..at the time I didn’t have any shortcodes being used on the site
 * This is an interesting point: if the plugin wasn’t doing any work, then it means
   there’s a memory issue only from being loaded..?
 * In the plugin settings, could you try turning off all modules one by one to see
   if any of them are directly related? For example, the [raw] shortcode by its 
   nature needs to parse the post content, which could be memory intensive.
 * Also, the plugin Query Monitor could be helpful in showing a stack trace of the
   error, to see where it originated.
 * Meanwhile, I’ll try to recreate the issue on my end to analyze where it could
   be happening.
 *  Thread Starter [Bryan Willis](https://wordpress.org/support/users/codecandid/)
 * (@codecandid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270410)
 * Hey thanks for the reply Eliot. I backed up the site so I could try it on WPENGINE
   because I know it will work there.
 * When this originally happened, Query Monitor was actually the first thing I checked,
   but since the page was “cashing out” before it was able load all the way, the
   Admin Bar and Query Monitor wouldn’t load.
 * Anyway, WP-ENGINE lets you create sandbox servers, so I’m going to try and recreate
   there. I’ll let you know when I do and can give you login access if you want 
   to check it out so you don’t have to waste your time trying to recreate. Just
   let me know.
 *  Thread Starter [Bryan Willis](https://wordpress.org/support/users/codecandid/)
 * (@codecandid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270414)
 * Hey Eliot I got to the bottom of it. I created a sandbox on WPENGINE and transferred
   over the .sql database file from the GoDaddy site. To my surprise it didn’t work
   there either and was bringing me to a 502 error page.
 * So I took the same steps I did on GoDaddy and I disabled all the plugins, then
   the genesis child theme, then genesis, and all the plugins. Still no luck.
 * The fatal error logged in the debug for exhausted memory occured on one of three
   lines below each time the page would load
 *     ```
       wp-includes/shortcodes.php on line 200
           wp-includes/shortcodes.php on line 227
           wp-includes/shortcodes.php on line 196
       ```
   
 * In the backend, while updating the post, query monitor would report [this](http://disputebills.com/site/uploads/2015/06/Screen-Shot-2015-06-27-at-6.49.20-AM.png)
 * Since this whole time I’d thought it was too long of a post I decided to see 
   how many words I could actually have before it broke, but not even that helped!
   I only had a paragraph left and it still broke.
 * Anyway, I switched to html mode and caught it right away. I wish I had done that
   earlier…
 * **This was the second sentence of the article:
 * [The study, published in _Health Affairs_ scientific journal](http://content.healthaffairs.org/content/34/6/922.abstract[content.healthaffairs.org]),
   found that 50 US hospitals were charging an average of 10 times the actual cost
   of providing care to their patients.
 * **But when looking at it in html mode, the comment you quoted me on about having
   no shortcodes caught my attention :
 * `<a href="http://content.healthaffairs.org/content/34/6/922.abstract[content.
   healthaffairs.org]">The study, published in <em>Health Affairs</em> scientific
   journal</a>, found that 50 US hospitals were charging an average of 10 times 
   the actual cost of providing care to their patients.`
 * I’ll tell the owner of the website to try to find a different link to point to
   because I know urls aren’t suppose use square brackets. However, what do you 
   think the odds are that we can fix this with custom content shortcode, since 
   it allows shortcodes to be used in urls?
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270434)
 * Ahh, I see, it’s interpreted as `[content]` which shows the content of the current
   post, which then runs it again, in an infinite loop. I actually came across this
   problem before – someone just put `[content]` in a post, which ran itself endlessly.
   I’ll work on a solution to detect this situation and stop it from happening.
 * I’m not sure if there is a way to prevent accidental shortcodes. The difficulty
   is that square brackets are fairly common to use, and that’s a fundamental design
   problem of shortcodes. The strange thing I see above, is that there is no closing
   square bracket `]` – so it looks like it shouldn’t be interpreted as a shortcode.
 * A couple related points.. There is a `[direct]` shortcode, which can be used 
   to disable shortcodes inside itself.
 *     ```
       [direct]
         Here, shortcodes like [content] are displayed directly, without running.
       [/direct]
       ```
   
 * Another point is about the _escape_ parameter for fields. When using a field 
   value in an HTML attribute like a link, this will prevent issues if the value
   contains special characters like `"` or `&`.
 *     ```
       <a href="[field url]" title="[field title escape='true']">
       ```
   
 * Anyway, I’ve started on a solution to prevent infinite loops, and will include
   it in the next update. Thanks for the information.
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270435)
 * OK, I just made a plugin update so `[content]` will detect if it’s showing the
   current post already, and show a warning if there’s an infinite loop happening.
 * Yes, I see the link ends with `[content.healthaffairs.org]` which was causing
   the issue. You’re right that `[` and `]` are not valid characters for URL and
   should be escaped.
 *  Thread Starter [Bryan Willis](https://wordpress.org/support/users/codecandid/)
 * (@codecandid)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270440)
 * Glad we got this figured out quickly. Thanks again for the quick responses. You’ve
   really done a great job with this plugin. Reminds me a lot of [Timber](https://wordpress.org/plugins/timber-library/),
   but way more convienent for wordpress. I’ve actually been taking some ideas from
   [https://github.com/cftp/shortcode-suggest](https://github.com/cftp/shortcode-suggest)
   and [http://gndev.info/shortcodes-ultimate/maker/](http://gndev.info/shortcodes-ultimate/maker/)
   the last month and am making an addon for custom-content-shortcode, that would
   give us a custom post type for the templates with autocompletion and an insert
   button on the post editor. I’ll let you know how it goes!
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270445)
 * Wow, first add-on for the plugin, cool! Curious to hear how it turns out. I’ve
   been using the front page of the plugin references as a place to put announcements
   and notices. I can put a link to your add-on there so people will know about 
   it.

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

The topic ‘Memory issues’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/memory-issues-8/#post-6270445)
 * Status: resolved