How to Increase PHP Memory Limit on WordPress Website

To fix WordPress memory issues, you can increase the PHP memory limit by editing wp-config.php, .htaccess, or php.ini. Alternatively, use a plugin for a simpler approach.

To increase the PHP memory limit in WordPress, you will need to modify the php(.)ini file. WordPress utilizes a default memory allocation that may be insufficient for handling server requests on a high-traffic website. While most shared and dedicated hosting accounts are optimized for WordPress, if you have a large number of plugins or need to upload large files, you might need to increase the memory available to WordPress.

To ensure the smooth operation of your WordPress website, it may be necessary to increase the PHP memory limit. This adjustment can be achieved through modifications to the htaccess file, wp-config(.)php file, or php(.)ini file. Increasing the PHP memory limit is a crucial initial step when installing a new theme on your WordPress site.

Why to Increase PHP Memory Limit

If you don’t increase php memory limit on your wordpress website, then you will get fatal error on your wordpress website and if php memory limit is low, if php resources are exhausted then fatal error will be thrown on your wordpress website and to avoid this fatal error (php memory limit error) you need to increase php memory limit.

How to Check WordPress Memory Limit

To check how much memory wordpress currently is set to in php.ini file to find these you will need to an FTP client such as filezilla and set up a new host in filezilla and connect to it using the ftp credentials from your hosting provider.

Inside of your FTP client navigate to your website folder then into wp-includes and locate the file named default-constance and open that with a text editor inside of default constant php file locate the line with WP_MEMORY_LIMIT on it the one above it is for you if you are using wordpress multi-site .

If you are using the regular version of wordpress look for WP memory limit underneath the else 40 megabytes is the current amount of allocated memory.

Related Coverage:

1. How to Fix Amp Validation Errors and Types of Amp Errors

2. Basic Syntax of HTML with Example

3. How to Do HTTP 301 Redirect SEO Http 301 WordPress htaccess File

4. Fix Yoast Sitemap Not Showing And Generating

5. What are 301 and 302 Redirect Pages and Difference Between them?

How to Increase PHP Memory Limit WordPress

Here are 4 methods to efficiently increase the PHP memory limit in WordPress.

WP Config File

To increase php memory limit in wordpress go to the root of your website then locate the file called wp-config(.)php open the file up with the editor and look for php memory limit. If you don’t have a memory limit set in your file type define followed by parenthesis and WP_MEMORY_LIMIT and all in caps then the new limit in quotes will change it to 512mb and end the line with semicolon below is how it is:

Just copy and paste this if its not declared in your wp-config(.)php file :- define ( ‘WP_MEMORY_LIMIT’, ‘512’); here php memory limit is increased to 512mb. Make necessary change and upload file to server and now your php memory limit increased.

Using PHP INI File

Create php ini file on your root folder of your wordpress website and then paste this code – ‘memory_limit’ = ‘512’; and save the file.

You can also directly find php ini file in your php settings and modify memory_limit settings.

Using htaccess

Open htaccess file on your wordpress root folder, (this folder will be hidden, as htaccess is a dot file) and open it and paste the code in htaccess file – php_value memory_limit 256M and save the file.

Note: Modifying htaccess file, if you are familiar with htaccess file modification only.

Use Php memory limit Plugin

WordPress has many plugins, you can go to plugin section on your wordpress backend settings and install any php memory limit increase plugin and increase memory limit of wordpress.

Contact Hosting Provider

You can directly contact your hosting provider and ask them to increase php memory limit on your webiste.

Lakshmi Durga
Lakshmi Durgahttps://www.asavvyweb.com
Lakshmi Durga is Senior Content Writer and Author and Also a Senior Editorial Team Member at A Savvy Web for More than 5 Years and She writes about technology related subject troubleshooting guides and helps users to solve issues. She has a Degree of Bachelor of Technology (Btech) from Kakatiya University and (Master of Technology) Mtech at Kakatiya University and JNTU university and is a real time Technology expert. She is a Real time Tech Expert and enthusiastic and has an Expertize in this technology area and writes specially on troubleshooting guides, solutions and tips and fixes and how to articles on Tech Related subjects like iPhone, Android, iOS, Smart tv and other tech related information.

- Advertisement -