Speeding up Wordpress on Local

Interestingly, the default PHP Memory allocation for a new WordPress installation on Local is only 40 MB.

Elementor’s system status flagged this and notified me it prefers at least 64 MB.

Increasing PHP memory can greatly speed up working on WordPress in your Local environment.

PHP memory can be set by entering the following in the wp-config.php file with the desired memory allocation:

/* -------------------------------------------------- /
/
CUSTOM SETTINGS FOR WP-CONFIG.PHP /
/
INCREASE PHP MEMORY TO 256 MB /
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
/
-------------------------------------------------- */

You can increase your PHP memory allocation to speed up WordPress.
You have to check however once you transfer the site to your host whether or not your host allows this much memory allocation for PHP.

1 Like

Thanks, marianco.

Can anyone from Flywheel comment on the optimal settings here? Especially interested in sites that are actually hosted on Flywheel.

I know that this is an old thread, but the info is relatively timeless, so here’s a little more to think on.

There are two primary memory limits for WordPress sites:

  1. WordPress’ default limit
  2. PHP’s default limit

That 40mb limit is the default that WordPress uses. You can find that value within the first 100 lines of the wp-includes/default-constants.php file that comes with WordPress Core.

Unless otherwise specified, for example, when adding define( ‘WP_MEMORY_LIMIT’, ‘256M’ ); to the wp-config.php file, WordPress will use 40mb.

On servers, PHP has a default memory limit too. You can verify what that is by looking at the configuration files, but I usually create and visit a PHP file instead. Within that file, add this code (but remember to remove the file when done so that others don’t learn too much about your system)

<?php
phpinfo();

That will give you all sorts of info about the PHP environment used to generate pages. You can see PHP’s limit under the “memory_limit” variable.

To @dgadwa question about what the optimal settings are: there’s no real right answer, it mostly boils down to economics and what the site owner is willing to pay for hosting.

WordPress sets it’s default low because that’s traditionally been enough to work with content on a site. The reason WordPress doesn’t have a higher default memory limit is that it is trying to set a sane default.

In general, pages on the internet are larger and have more images, styles, and javascript. For these pages within WordPress that are created using page-builder tools like Elementor, that means that the memory needed to edit these large pages is often higher.

So what’s the right answer for settings? Whatever is required by the tools you want to use to create sites. Page builders and Plugins that need more resources will cost more because they require more resources to operate.

Elementor is a great tool. It also requires more resources than what WordPress deems as being a reasonable default.

1 Like

so finally quitting after 4 days of wasting the time on a piece of trash and crap software.

1 Like

i will be the happiest person if this becomes fast as it should be as a localhost in this lifetime.

1 Like

Do you have local on your system?

Great Thanks,
Rakshit Jain

Great, can you give me video demo as how fast does local normally responds in browser.

Great Thanks,
Rakshit Jain

I’m sorry that you’ve been struggling with an issue for so long, but there’s no need to take out your frustrations like this, here in the forums.

Speaking from personal experience, Local, especially more recent versions of it, has been quite performant and any slowness with a site tends to be due to something within the way that it is coded.

Some things to ask yourself and explore:

  1. Am I on the most recent version of Local?
  2. Do I have the same slowness when working with a new, plain WordPress sites?
  3. Using a tool like Query Monitor, are there certain queries or external API calls that are making WordPress slow?
  4. How many plugins are being used to generate the page? As a rule of thumb, the more plugins you throw on a site, the greater the chance it will experience some slowness.
  5. How large is the site and is it too large for the hardware that this laptop is using to serve the site?

Hope that gives you some direction on how to improve the performance of the site in Local.

  1. Ver 5.3.1 latest

  2. Wp fresh install taking 300 secs to load with default theme and no plugins.

  3. site is 40 MB or as big as what a fresh wp is.

Great Thanks,
Rakshit Jain

1 Like

@rakshitjain out of curiosity have you tried running the site in different browsers?

Here’s a quick demo. I only edited a couple of seconds around my password entry.

I’m on a 2019 16" MacBook Pro, running Catalina, and Local Beta 5.3.1

Yes in opera.

Great Thanks,
Rakshit Jain

there i a new error now on local.

Thank you It worked on my local i did these 3 steps

  1. Edit the (php.ini) file by adding: memory_limit = 256M
  2. Edit (wp-config.php) file by adding: define (‘WP_MEMORY_LIMIT’, ‘256M’);
    3.Edit (default-constants.php) file by replacing 64M and 40M both to 256M

The max memory limit was already 256M
By the way I am using Bricks builder and thats one of the requirements for it 64M but I maxed it out anyway
hope that helps thanks