To optimize the performance of websites running WordPress and Divi, I’ve compiled this list of tweaks that we have found useful.
As WordPress evolves and as Elegant Themes adds features to Divi, they require more resources from the server. In most cases, with limited resources, the website will continue to function, however it may be slow to respond and certain features may fail to load. For example, in situations where there are insufficient server resources, the Divi Builder may timeout or behave in unexpected ways.
To maximize server resources, I’ve compiled this list of host platform tweaks. These tweaks will not only help avoid Divi Builder issues, they will also improve the overall performance of your website.
Please note that hosting providers configure their platforms differently and my tweaks might not work in all cases. So your mileage may vary.
.htaccess file
If you are experiencing timeout issues with the Divi Builder, adding this code to your .htaccess file would be the first step I’d recommend.
You’ll find the .htaccess in your WordPress root directory (often /public_html). It’s a hidden file, so if you are using cPanel’s File Manager, you’ll need to check the Show Hidden Files checkbox.
I usually add this code to the bottom of the file.
<IfModule mod_substitute.c> SubstituteMaxLineLength 10M </IfModule>
Note: The source for this information was this article.
wp-config.php
The next step I recommend is allowing WordPress more memory. Often, I find this set to 64M or 128M. I usually increase this to 512M. However, your hosting provider may not provide this much memory, so check their specs.
The wp-config.php file also lives in the WordPress root directory.
If this line already exists, simply update the amount of memory. If not, then add it near the bottom of the file.
define( 'WP_MEMORY_LIMIT', '512M' );
PHP Version
PHP Version 7 significantly outperforms older versions.
Most hosting platforms using cPanel offer a PHP Version tool which you can use to see which version you are running. If you are running on an older versions of PHP, upgrade to version 7.
Please note, that there are still some plugins that don’t like PHP version 7. (At this point, all well-maintained plugins have been upgraded.) To be sure, test your website after the update.
php.ini
The next set of changes optimize PHP, increasing the resources available to WordPress.
Normally, these get added to php.ini. However, the method of configuring PHP varies widely between hosting providers. So check their documentation. Also note, some configurations required a php.ini in each subdirectory. Again, read the documentation provided by your hosting service.
Some hosting providers have a large php.ini file that contains just about every option. In this case, you’ll need to modify their settings. On other hosting providers, you may have to start by creating a blank php.ini file and adding this code:
upload_max_filesize = 128M max_input_time = 120 memory_limit = 768M post_max_size = 128M max_input_vars = 6000 max_execution_time = 120
Note: The memory_limit of 768M is what SiteGround provides. Your hosting platform might be more or less.
Summary
Before testing, be sure to clear any server caches (in WordPress and any provided by your hosting platform) and to do the same with your browser’s cache.
We’ve found these tweaks to be helpful. I hope they help you.
Please be sure to check your hosting provider’s documentation, if you experience any problems.
Thanks for these tweaks, Tom. I’m on Siteground too – do they provide the php.ini file? I don’t see one, but i wanted to make sure I was looking in the right place.
Something I’d love to see in an article (I will search your blog to see if you have it) is how you set up your hosting clients on SiteGround. Right now, they’re all add on domains in my account, but you can see their site tries to load from my main site if you know what to look for. Not sure that’s the best way to go. 🙂
Thanks for the tips! I love your Divi stuff too.
By default, SiteGround doesn’t have a php.ini file. They will tell you that have to use their PHP Variables app in cPanel. But you can create one by hand if you prefer.
Beware, if you have more than one domain or multiple subdomains, each will need it’s own php.ini.
The danger with having multiple WordPress installations on the same hosting account is that if a hacker accesses one, he has access to them all. When that happens, cleanup is a nightmare.