WordPress sets a default PHP memory limit during the installation process and there are times when you might need to increase this limit. Instances when this might happen include error diagnosis, and plugin or theme installation. For example, you might be getting the white screen of death or another error which is occurring because of a lack of memory.

In other instances, some themes and plugins may require WordPress to have access to more memory than is currently available. In both situations, you should increase the PHP memory limit.

Depending on your hosting, you may not be able to increase the memory size. Many shared hosts limit the amount of memory used by WordPress and some may not allow you to increase the PHP memory limit. Before you do anything, you should speak to your hosting provider first. If they do allow you to increase the PHP memory limit, they may even do for you. At the very least, they can advise you about the maximum limit allowed in your plan.

What to Set Your PHP Memory Limit to?

If you have a problem with WordPress, you should search the internet to and try to diagnose your issue. Assuming that a lack of memory is causing the problem, you can increase the limit until the issue is resolved.

On the other hand, if you need to increase the memory limit for a plugin or theme, then the developer should be able to tell you the amount of PHP memory required.

Three Ways to increase the PHP memory limit for WordPress

There isn’t only one way to achieve a PHP memory increase with WordPress. There are three options available. You must complete the first option and either one of the second options may or may not work for you. In some instances, option number two will work and in other cases, option number three will work. It may be that neither option actually increases the memory limit and you’ll need to contact your hosting provider.

1. Edit wp-config.php

You will need to complete this step before doing anything else. The wp-config.php file tells WordPress how much memory it’s allowed to use. Even if your server is set to a higher amount, the wp-config.php can still limit the amount used by WordPress. Therefore, before you do anything, you need to increase this limitation.

Open your wp-config.php file which can be found in the root directory of your WordPress installation. Search for a line which says:
define(‘WP_MEMORY_LIMIT’, ‘128M’);

In some cases, the limit will be set to different amounts. Simply edit the number before the M (Megabytes) to the desired amount. If your wp-config.php file doesn’t contain this line, you can add it yourself at the end of the file.

2. Edit php.ini

If you have access to the php.ini file on your server, you can edit it to increase the memory allocation. Some hosting providers and plans don’t provide access to the php.ini file. If this is the case, you should skip this part and move on to editing the .htaccess file below.

3. Edit .htaccess

If you don’t already have an .htaccess file, you can create one in notepad by saving an empty file name and using the .htaccess extension. If you already have an .htaccess file, then you can just add the following line to the top:

php_value memory_limit 128M

This line of code will increase your memory limit to 128MB.

Before you do anything, you should check that your hosting provider allows you to increase PHP memory limits. Then the next thing you need to do is edit the wp-config.php file to tell WordPress how much memory it can use.

You then need to ensure that your server can provide that amount of memory by editing the php.ini file. Some hosts don’t always provide access to the php.ini file. Alternatively, if you can’t edit your php.ini file, or it doesn’t seem to have any effect, then you should edit your .htaccess file.

If none of the above has worked, you will need to contact your hosting provider and ask them to help you. It may be that on your current hosting plan, you can’t increase memory allocation. In some cases, the support team has to do it for you.

Wordpress Hosting

Experience the difference with the fastest WordPress hosting platform.

Elastic Hosting

A flexible managed hosting solution that will grow with you and your needs grow.

Cloud Servers

Your dedicated cloud servers that are managed by us or managed by you.

Made InCanada
Made by Canadians,
for Canadians

Never worry about compliance again. Our servers are hosted directly on Canadian soil, and support is given by a 100% Canadian team.

We Start,
Where Others Stop.

If you've been burned by terrible hosting services before, we get you. We want every client to feel important and fully taken care of, and we'll spend the time it takes to solve any problem that arises.

Trusted by Clients Across All Industries

Don't take our word for it - let our happy clients do the talking. See More

Full Host did an amazing job of migrating my site seamlessly onto their server. My only regret was not switching my site over to them sooner. Now it is performing great, images are uploading way faster than ever before.

" Vancouver Sofa and Patio - Jerry Schmidt

Two thumbs up for Fullhost! Agents reply to me fairly quickly or at least let me know they received the ticket and are looking into it. Kudos to the support team as they have always given me exactly what I need without delays.

" Universal Staffing Inc. - Anthony Calvano

FullHost is an absolute pleasure to work with, and their customer service is exceptional. Whenever I have questions or need adjustments, they are there to help, quickly, efficiently, with answers and insights.

" Mooseworld Inc. Norine Leibel

With coast to coast coverage,
We help you serve the world.

Whether your audience is located in Europe, Asia, Africa, or Australia, provide them with lightening speed!

FullHost's data centers are located in Toronto and Vancouver to ensure worldwide quality and speed.

Get in Touch
We Trust Only The Best Tech to Support You

FullHost operates with the most innovative technology to bring you unparalleled levels of hosting services.