Increase PHP Memory Limit: 7 Easy Ways in Hostinger WordPress (2026 Guide)

Increase PHP Memory Limit

Introduction

If you’re seeing fatal errors, white screens, plugin installation failures, or Elementor loading issues, it’s time to Increase PHP Memory Limit on your WordPress website. The PHP memory limit controls how much memory WordPress scripts can use while running. When the limit is too low, your website may become slow or display unexpected errors.

In this guide, I’ll show you the exact methods I use on Hostinger-hosted WordPress websites to safely increase the PHP memory limit. Whether you’re a beginner or an experienced user, these steps will help improve your site’s stability and performance.

Increase PHP Memory Limit

Table of Contents

  • What Is PHP Memory Limit?
  • Why Increase PHP Memory Limit?
  • Signs Your Website Needs More Memory
  • Check Current PHP Memory Limit
  • Method 1: Increase Memory from wp-config.php
  • Method 2: Increase Memory Using Hostinger hPanel
  • FAQs
  • Final Thoughts

What Is PHP Memory Limit?

The PHP memory limit is the maximum amount of memory a PHP script can use while executing. WordPress relies on PHP for almost everything, including loading plugins, themes, and the admin dashboard.

When the available memory is exhausted, WordPress may stop working correctly and display fatal error messages.

Typical default memory limits include:

  • 64 MB
  • 128 MB
  • 256 MB
  • 512 MB

For most modern WordPress websites, 256 MB is recommended.


Why Should You Increase PHP Memory Limit?

Increasing the PHP memory limit can resolve many common WordPress issues.

Benefits include:

  • Better website performance
  • Smoother Elementor editing
  • Faster plugin updates
  • Reduced fatal errors
  • Better WooCommerce compatibility
  • Improved admin dashboard responsiveness

If your website uses many plugins or page builders, increasing the memory limit is often necessary.


Common Signs You Need More PHP Memory

Your website may require a higher memory limit if you notice:

  • White Screen of Death
  • Elementor stuck loading
  • 500 Internal Server Error
  • Plugin update failures
  • Theme installation errors
  • “Allowed memory size exhausted” messages
  • Slow WordPress dashboard

These issues often indicate that PHP has reached its memory limit.

Internal Link:
https://wpwitharb.com/elementor-stuck-on-loading-screen/


Check Your Current PHP Memory Limit

Before making changes, check the current memory limit.

Method 1

Install the Site Health tool.

Go to:

Tools → Site Health → Info → Server

Locate:

PHP Memory Limit

Method 2

Install the WP Server Stats plugin or any similar server information plugin.

This displays the current PHP configuration directly in your dashboard.


Method 1: Increase PHP Memory Limit Using wp-config.php

This is the most common and recommended method.

Step 1

Open your website files using:

  • Hostinger File Manager
  • FTP Client
  • File Manager in hPanel

Navigate to your WordPress root directory.

Locate:

wp-config.php

Step 2

Find this line:

/* That's all, stop editing! Happy publishing. */

Add the following code immediately above it:

define('WP_MEMORY_LIMIT', '256M');

Save the file.

Reload your WordPress dashboard.

For most websites, this immediately increases the available PHP memory.


Recommended Memory Limits

Website TypeRecommended Memory
Blog128 MB
Business Website256 MB
WooCommerce Store256–512 MB
Elementor Website256 MB
Membership Website512 MB

Method 2: Increase PHP Memory Limit Using Hostinger hPanel

If your hosting plan allows custom PHP settings, this method is even easier.

Step 1

Log in to your Hostinger hPanel.

Open:

Advanced → PHP Configuration

You’ll see several PHP options.


Step 2

Locate:

Memory Limit

Change it to:

  • 256 MB
  • or 512 MB

Click Save.

Wait a few moments for the changes to apply.

Increase PHP Memory Limit in Hostinger

Method 3: Increase PHP Memory Limit Using php.ini

Some hosting environments allow you to modify the PHP memory limit through the php.ini file.

If your website has a php.ini file, open it and locate the following line:

memory_limit = 128M

Change it to:

memory_limit = 256M

or

memory_limit = 512M

Save the file and restart PHP if your hosting provider requires it.

This method is useful for VPS and dedicated hosting environments.


Method 4: Increase PHP Memory Limit Using .htaccess

If your hosting supports Apache and allows PHP directives in the .htaccess file, you can increase the memory limit there.

Open your .htaccess file and add:

php_value memory_limit 256M

Save the file.

If your website shows a 500 Internal Server Error, remove this line immediately because some servers don’t allow PHP directives inside .htaccess.

Internal Link:
https://wpwitharb.com/how-to-fix-500-internal-server-error-in-wordpress/


Method 5: Contact Hostinger Support

If none of the previous methods work, your hosting plan may restrict PHP configuration changes.

Hostinger Support can:

  • Increase your PHP memory limit
  • Check server configuration
  • Identify memory-related issues
  • Verify account limitations
  • Recommend the best PHP settings

Their support team is available 24/7 and can usually resolve memory-related issues quickly.

External DoFollow Link:
https://support.hostinger.com/


Verify the New PHP Memory Limit

After increasing the memory limit, confirm that the change has been applied.

Option 1

Go to:

WordPress Dashboard → Tools → Site Health → Info → Server

Check:

PHP Memory Limit


Option 2

Install the WP Server Stats plugin.

Open the plugin dashboard and verify the updated memory value.


Option 3

Create a temporary PHP file named:

<?php phpinfo(); ?>

Visit the file in your browser and search for:

memory_limit

Delete the file after checking the value to avoid exposing server information.

Increase PHP Memory Limit verification

Best PHP Memory Limits for Different Websites

Choosing the correct memory limit depends on your website.

Website TypeRecommended Memory
Personal Blog128 MB
Business Website256 MB
WooCommerce Store512 MB
Elementor Website256 MB
LMS Website512 MB
Membership Website512 MB

Using an unnecessarily high memory limit won’t automatically make your website faster, but setting it too low can cause frequent errors.


Common WordPress Errors Fixed by Increasing PHP Memory Limit

Increasing the memory limit often resolves:

  • Elementor Stuck on Loading Screen
  • White Screen of Death
  • 500 Internal Server Error
  • Error Establishing a Database Connection (in some server-related cases)
  • Plugin Installation Failed
  • Theme Installation Failed
  • Allowed Memory Size Exhausted
  • WordPress Dashboard Loading Slowly

Internal Link:
https://wpwitharb.com/error-establishing-a-database-connection/


Best Practices

Follow these recommendations to keep your WordPress website stable:

  • Keep WordPress updated.
  • Update themes and plugins regularly.
  • Remove unused plugins.
  • Use lightweight themes.
  • Optimize images before uploading.
  • Enable caching.
  • Monitor server resources.
  • Upgrade hosting if your website grows significantly.

These practices reduce memory usage and improve overall performance.

Internal Link:
https://wpwitharb.com/how-to-speed-up-your-wordpress-website-using-litespeed-cache/


Common Mistakes to Avoid

Many beginners make these mistakes:

  • Setting the memory limit to an extremely high value without checking hosting limits.
  • Editing the wrong file.
  • Forgetting to save changes.
  • Leaving the phpinfo() file on the server.
  • Running too many heavy plugins.
  • Ignoring plugin conflicts.

Always back up your website before editing configuration files.


Frequently Asked Questions

What is the recommended PHP memory limit for WordPress?

For most websites, 256 MB is sufficient. WooCommerce stores and large Elementor websites often benefit from 512 MB.


Can increasing PHP memory improve website speed?

It doesn’t directly increase speed, but it prevents memory-related errors and allows plugins and themes to run more efficiently.


Is it safe to edit wp-config.php?

Yes, as long as you only add the recommended line and avoid modifying other settings. Always create a backup before making changes.


Why didn’t my memory limit change?

Some hosting providers override PHP settings at the server level. In that case, contact your hosting support team for assistance.


Related Articles

Continue optimizing your WordPress website:


Final Thoughts

Knowing how to Increase PHP Memory Limit is an essential WordPress maintenance skill. A properly configured memory limit helps prevent common issues such as plugin failures, Elementor loading problems, and fatal PHP errors. On Hostinger, the process is straightforward using wp-config.php or hPanel, making it easy even for beginners.

After increasing the memory limit, monitor your website regularly using the Site Health tool and keep your plugins, themes, and WordPress core updated. Combining proper memory settings with good optimization practices will help your website remain fast, stable, and reliable.

Leave a Comment

Your email address will not be published. Required fields are marked *