Close Menu
WordPress ExpertsWordPress Experts
    WordPress ExpertsWordPress Experts
    • Salesforce
    • 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

    WP Experts TeamBy WP Experts TeamMarch 5, 2023Updated:March 5, 2023No Comments3 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 How to fix WordPress login page refreshing/redirecting issue
    WP Experts Team
    • Website

    As a global digital solutions partner, we empower businesses with integrated technology platforms. We specialize in crafting high-performance WordPress websites—from custom design and SEO-optimized content to robust e-commerce. Furthermore, we unlock growth by implementing and optimizing Salesforce, streamlining your CRM, and automating sales and service processes. From your digital storefront to your customer relationships, we provide end-to-end solutions to achieve your online goals.

    Related Posts

    WordPress Errors

    Beginner’s Guide to Troubleshooting WordPress Errors

    November 20, 2025
    WordPress Errors

    What to do when you are locked out of WordPress admin area

    November 20, 2025
    WordPress Errors

    How to fix common image issues in WordPress

    November 20, 2025
    Add A Comment

    Comments are closed.

    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

    Write for Us – Submit Guest Post (Technology, WordPress, CRM & AI)

    December 2, 2025

    Stop Wasting Time: Sync Your Website and CRM

    December 2, 2025

    How to Connect WordPress to Salesforce: A Step-by-Step Guide for 2025

    November 27, 2025

    How to Create a Free Business Email Address to Boost Your Brand

    November 25, 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.