How to fix the dreaded WordPress Memory Limit Error




Arrrgh! How to fix the dreaded WordPress Memory Limit Error

How to fix WordPress memory limit error

How to fix the dreaded WordPress Memory

There was a time when I would wake up in the middle of the night in cold sweats, panicking that a client’s website we were building would crash. To a new developer there are few things that are worse. After being in the trenches for a couple of years, I birthed a mantra up at the office:

“If you don’t crash a site at least once a day, then you are not working hard enough.”

Keep in mind that this saying only applies to sites in development. If a live website crashes, the world is coming to an end and someone has a big problem. As many of you developers and/or bloggers know, out of many a story or memory or teachable moment rises from the ashes…

Currently, I am building out a new membership site for my associate’s upcoming digital course. In the process of installing the required WordPress plugins, the site crashed (see image below). If this has happened to you, do not panic just yet. In this quick tutorial I will walk you through the steps that I take when this error occurs.

Note: You will need access to your hosting cPanel to fix this error.

PHP fatal error WordPress

Why Memory Limit Error

This tends to be an issue associated to size of WordPress plugins or the number of plugins that you have installed on your site. I have noticed that as plugins become more robust, they require more and more memory. This is not an issue that a basic blog should run across but as with all things, it can depend. Your memory allocation can also be impacted by the theme that you are using and will vary based upon your hosting company.

In the case of this current site that I am working on, it will run a membership plugin, a forum, add-ons for each of these and the standard plugins that an average WordPress site runs.

First order of business

If you see the fatal memory size error on your WordPress blog or site, the first thing that you will want to do is get the site back up and running. In my situation this happened when I installed a plugin, so the quick solution was obvious. If you just woke up and your blog was showing this error and have no idea why, then you will want to skip down to step 11.

Quick Summary

✓ Turn off WordPress Plugin using the hosting cPanel
✓ Install code to wp-config.php to increase memory
✓ Turn on WordPress Plugin using the hosting cPanel

Turn off WordPress Plugin at cPanel

Step 1: Log in to your hosts cPanel
Step 2: Click on File Manager

cPanel WordPress memory fix

Step 3: Check “Show Hidden Files”
Step 4: Click on Go

Access WP php error cPanel

Step 5: Click on wp-content

fix WP memory error for php

Step 6: Highlight the plugin that you want to turn off by selecting on it.
Step 7: Click on Rename

increase WordPress php limit

Step 8: Type in the number 1 at the end of the plugin name.
Step 9: Click on Rename File

WP increase php

Step 10: Refresh the site.

The WordPress plugin that caused the site to crash will be noted as deactivated and your site should reappear. Now, we need to add some code to your wp-config.php so that you no longer have this fatal error when you turn the plugin back on.

Increase WordPress PHP Memory Limit

Step 11: Click on wp-config.php from the Code Editor

WordPress large plugin install

Step 12: Click on wp-config.php to select it
Step 13: Click on Code Editor

WordPress plugin crash

Step 14: Paste code as shown below.

define(‘WP_MEMORY_LIMIT’, ‘128M’);

WP_MEMORY_LIMIT’, ‘128M

Step 15: To re-enable your plugin, follow Steps 1–10 again, except this time remove the 1 from the plugin name at Step 8.

I would like to close this post by asking you a question: When is the last time that you backed up your site? Do you use a backup plugin? I ask this question because no matter how well a blog or website is built, things will just sometimes go wrong. We recently purchased BackupBuddy from iThemes and it may be the smartest investment we have made all year. (We aren’t affiliates YET, but we hope to be, and we highly recommend this tool to save you time and the agony of lost content.) If you have a solid backup of your blog and it crashes, you will breathe just a little easier.

About the Author

Renee is wild for WordPress and on fire to empower small business owners with the inspiration, tools and strategies for a healthy blog. SMU CAPE instructor, developer, podcaster. Follow @Iteachblogging on Twitter. Get her FREE SEO Guide Here: https://goo.gl/gGrHC2

Leave a Reply 0 comments