Close Menu
WordPress ExpertsWordPress Experts
    • Client Experiences
    • WordPress Forms
    • Page Builder Services
    • Woocommerce
    • WordPress Migration
    • WordPress Maintenance & Support
    • WordPress Theme Customization
    • Website Malware Removal
    • E-Learning
    WordPress ExpertsWordPress Experts
    • Tips and Tricks
    • WordPress
      • WordPress Errors
      • WordPress Themes
      • WordPress Performance
      • WordPress Plugins
      • WordPress SEO
        • Google AdSense
      • Vulnerabilities
      • Responsive WordPress Themes
    • WooCommerce
      • WooCommerce Tips
    • WordPress Security
      • Wordfence
    • Contact Us
    WordPress ExpertsWordPress Experts
    Home»WordPress Errors»How to fix WordPress memory exhausted error by increasing PHP memory limit
    WordPress Errors

    How to fix WordPress memory exhausted error by increasing PHP memory limit

    Wordpress ExpertsBy Wordpress ExpertsMarch 5, 2023Updated:March 5, 20231 Comment3 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Fix WordPress Memory Exhausted Error – Increase PHP Memory
    Share
    Facebook Twitter LinkedIn Pinterest Email
    Fix WordPress Memory Exhausted Error – Increase PHP Memory

    WordPress is a powerful and popular content management system (CMS) used by millions of people around the world to create and manage websites. However, one common issue that users may face when working with WordPress is the “memory exhausted” error. This error occurs when the PHP memory limit set for WordPress is exceeded, and it can cause the website to crash or become unresponsive.

    If you’re experiencing the WordPress memory exhausted error, don’t worry – there are several ways to fix it. In this article, we’ll go over how to increase the PHP memory limit for your WordPress site, which is the most common solution.

    Step 1: Determine the Current PHP Memory Limit

    Before we can increase the PHP memory limit, we need to know what the current limit is. To do this, you can create a new PHP file and add the following code:

    				
    					<?php
    phpinfo();
    ?>
    				
    			

    Save the file as phpinfo.php and upload it to your website’s root directory. Then, access the file through your web browser (e.g. http://yourwebsite.com/phpinfo.php). This will display a page with detailed information about your PHP configuration, including the memory limit.

    Look for the “memory_limit” setting, which will display the current PHP memory limit. It will likely be set to something like “64M” or “128M”.

    Step 2: Increase the PHP Memory Limit

    Now that we know the current PHP memory limit, we can increase it to prevent the memory exhausted error. There are several ways to do this, depending on your hosting environment and the level of access you have to your server.

    Method 1: Edit the wp-config.php File

    The simplest and most common way to increase the PHP memory limit is by editing the wp-config.php file. This file contains important configuration settings for your WordPress site, including the PHP memory limit.

    To increase the PHP memory limit, open the wp-config.php file in a text editor and add the following code:

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

    This code sets the PHP memory limit to 256 megabytes, but you can adjust the value to suit your needs. Save the file and upload it back to your server.

    Method 2: Edit the .htaccess File

    If you’re unable to edit the wp-config.php file, you can also increase the PHP memory limit by editing the .htaccess file. This file is used to configure Apache web servers and can be found in the root directory of your WordPress site.

    To increase the PHP memory limit, add the following code to the .htaccess file:

    php_value memory_limit 256M

    Again, you can adjust the value to suit your needs. Save the file and upload it back to your server.

    Method 3: Edit the php.ini File

    If you have access to the server’s php.ini file, you can also increase the PHP memory limit by editing this file. The php.ini file is a configuration file for PHP and is typically located in the root directory of your server.

    To increase the PHP memory limit, find the following line in the php.ini file:

    memory_limit = 64M

    Change the value to your desired memory limit (e.g. 256M) and save the file.

    Step 3: Verify the New PHP Memory Limit

    After increasing the PHP memory limit, you should verify that the new limit has been applied. You can do this by creating a new PHP file and adding the following code:

    				
    					<?php
    echo 'Current PHP memory limit: ' . ini_get('memory_limit');
    ?>
    				
    			

    Save the file and upload it to your server. Then, access the file through your web browser to see the current PHP memory limit.

    Conclusion

    The WordPress memory exhausted error can be frustrating, but increasing the PHP memory limit is a simple

    Get help form WordPress Experts

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to fix white text and missing buttons in WordPress visual editor
    Next Article What to do when you are locked out of WordPress admin area
    Wordpress Experts
    • Website

    As leading WordPress experts, we provide a full range of services to businesses worldwide, including high-quality blog content, custom website design and development, SEO optimization, e-commerce solutions, and ongoing maintenance. We specialize in crafting engaging and informative blog posts that drive organic traffic and enhance your online visibility. Our team is dedicated to delivering exceptional results and empowering businesses to achieve their online goals through innovative WordPress solutions.

    Related Posts

    WordPress Errors

    How to Fix the “Cookies Are Blocked Due to Unexpected Output” Error in WordPress

    December 23, 2024
    Blog

    Common WordPress Plugin Conflicts and How to Resolve Them

    October 27, 2023
    WordPress Errors

    Beginner’s Guide to Troubleshooting WordPress Errors

    April 21, 2023
    View 1 Comment

    1 Comment

    1. Pingback: 5 Most Common WordPress Errors and How to Fix Them

    fix hacked wordpress websites and remove malware
    fix wordpress issues
    create a wordpress website with elementor
    fix woocommerce issues and customize theme
    migrate or clone wordpress site to new host or domain
    Top Articles

    Elementor Pro 3.29.1 Free Download

    June 3, 2025

    How to Get Elementor Pro 3.29.0 Free: Safe Tips and Alternatives

    May 20, 2025

    How to Become a WordPress Expert: A Step-by-Step Guide

    May 7, 2025

    Elementor Pro 3.28.3 POR + 3.28.4 FREE Download

    April 29, 2025
    • Client Experiences
    • WordPress Forms
    • Page Builder Services
    • Woocommerce
    • WordPress Migration
    • WordPress Maintenance & Support
    • WordPress Theme Customization
    • Website Malware Removal
    • E-Learning
    © 2025 WordPress Experts All rights reserved

    Type above and press Enter to search. Press Esc to cancel.