There are a number of reasons why you may want to increase wordpress memory limit on your WordPress site, and there are several ways to do this. The most common reason for this is to fix errors that occur when your site starts using more memory than it is able to use.
These errors include a white screen of death and 500 internal server errors. You may need to multiply your PHP memory size by a number that corresponds to your growing site.
Either way, you need to raise your bar. Let’s take a look at how you can do this in WordPress. This guide is written for beginners, so don’t miss any section where you feel too slow.
How to access your WordPress site’s files with FTP
I use FileZilla for this example, but am aware that there are a lot of FTP clients out there. Click here to download FileZilla that is compatible with your operating system.
To install FileZilla, download the installer and run the installer. Run it after you finish it.
In the menu above, click File and select Site Manager. To tag your site, enter a site name and enter the following settings:
Host – Your domain.com.com
Port – Leave blank.
Protocol – FTP – File transfer protocol
Encryption – use only normal FTP (not dangerous)
Logon type – default
Use the username and password you use to access the hosting site administrator as the username and password for the FTP server. If your host is using cPanel, enter the username and password you will use to log in to cPanel.
Open the “Transfer Settings” tab and check the limited number of Synchronous connections. Enter 8 as the greatest number of associations
Click “Connect” to access your site’s files via the FTP server.
Find the WordPress memory limit of your website
By looking at the default-constants.php file, we can see how our WordPress memory limit is set. This file contains several lines of code that deal with memory limitations in WordPress.
Open your directory in FileZilla. This is usually called public_html.
Open the wp-containing file of your site and find your standard-constants.php file. Double-click it to download it to your computer.
Open it with a word processor on your framework. At the top of this file you should see a few lines of code related to your site’s memory limit:
This means that the memory limit in WordPress has been set to 64 MB for multi-dimensional installation and 40 MB for normal WordPress sites. The WP_MAX_MEMORY_LIMIT setting under these lines of code refers to the amount of memory allowed to be used on the administrative side of things.
WP_MEMORY_LIMIT = previous section
WP_MAX_MEMORY_LIMIT = back end
So, in the wp-config.php file, we change the WordPress memory limit of our site. To override the restriction set in the default-constants.php file, we use the function specified from the default-constants.php file.
Increase the memory limit of PHP and the memory limit of WordPress
Try only one of these solutions. If you can’t do a single thing, make sure you delete your files from the code before moving on to the next solution.
Return to the main directory of your site (public_html). If you see folders called wp-content, wp-admin and wp-include, you will be where you want to be.
Before you get started, clear your browser’s cookies and caches, both of which won’t affect what your site will look like in your browser.
Increase the memory size of PHP in php.ini
Open your wp-admin folder and check if there is a file named php.ini or php5.ini. This may not be the case, but if the file is uploaded to your computer, double-click and open it.
If there is no file, open a text editor on your computer.
On the off chance that you are altering your php.ini or php5.ini document, discover the line that contains the memory_limit and M esteems and change it to:
If you are creating your own file, put in this code to your text editor:
Save the file and name it php.ini, for example:
If you’re not familiar with FileZilla and FTP clients at all, you’ll see that FileZilla has four “views” or “panels”. Consider the bottom two side by side. Use the left side to find where you saved the php.ini file on your computer.
Make sure your wp-admin folder is still open in your right pane. If you are sure, drag the php.ini file from the left pane to the right pane to upload the file to your site. If you are editing an existing php.ini file, overwrite the original.
Update the FTP client as shown in the image above. If you increase your memory limit to fix a specific error on your site, update your site to make sure the error doesn’t go away. If not, try raising the 512M value to something else. Alternatively, you can try converting the php.ini file to php5.ini.
If you want to use another solution, delete the php.ini file from your site.
Increase the size of your WordPress memory in wp-config.php
Double-click your wp-config.php file to download to the system. Open it in a text editor and add the following bit code to it:
Save the file and overwrite the original and upload it to your root directory. Update the FTP client and update your site to make sure the error does not go away. Increase the value to 64M if necessary.
If you encounter errors while working in the WordPress administration area, try adding the WP_MAX_MEMORY_LIMIT code under the memory limit code, for example:
|define(‘WP_MEMORY_LIMIT’, ‘64M’); define(‘WP_MAX_MEMORY_LIMIT’, 128M’);|
Increase the maximum memory limit if necessary. Make sure this is always above the WordPress memory limit.