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:
- WordPress’ default limit
- 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.