Boost Elementor Speed: PHP Tweaks and WordPress Optimization Tips

WordPress and Website Performance

Elementor is powerful, but it can be slow if your server isn't optimized. Slow Elementor sites usually come down to PHP settings, WordPress configuration, or how Elementor itself is set up. This guide covers the PHP tweaks and WordPress optimizations that actually make a difference for Elementor performance.

I'll walk you through increasing PHP memory limits, optimizing PHP settings, configuring WordPress for better performance, and Elementor-specific optimizations. These changes can dramatically improve your site's speed, especially in the Elementor editor and on the frontend.

TL;DR

  • Increase PHP memory: Set memory_limit to 512M or 1024M in php.ini or wp-config.php
  • Optimize PHP settings: Increase max_execution_time, max_input_vars, and post_max_size
  • WordPress optimizations: Use caching plugin, optimize database, limit post revisions
  • Elementor settings: Disable unused widgets, use CSS print method, enable font-display swap
  • Use object caching: Redis or Memcached for database query caching
  • Optimize images: Use WebP format, lazy loading, and image optimization plugins

Why Elementor Can Be Slow

Elementor is a resource-intensive page builder. It loads many CSS and JavaScript files, processes complex layouts, and renders widgets dynamically. Common bottlenecks include:

  • Low PHP memory limit: Elementor needs memory to process page content
  • Slow PHP execution: Outdated PHP versions or inefficient processing
  • Excessive database queries: WordPress making too many database calls
  • Unoptimized assets: CSS and JavaScript files not being cached or minified
  • Server resource limits: CPU or memory constraints on shared hosting

PHP Memory Limit: The Most Important Fix

Elementor needs sufficient PHP memory to load and process page content. The default PHP memory limit (often 128M or 256M) is usually too low for complex Elementor pages.

Recommended PHP Memory Limit

For Elementor sites, I recommend:

  • 256M minimum: Basic Elementor sites with simple layouts
  • 512M recommended: Most Elementor sites with moderate complexity
  • 1024M for complex sites: Heavy Elementor usage with many widgets and sections

How to Increase PHP Memory Limit

You can increase PHP memory limit in several ways. Try these in order:

Method 1: wp-config.php (Recommended)

Add this line to your wp-config.php file, just before the "That's all, stop editing!" line:

define('WP_MEMORY_LIMIT', '512M');
define('WP_MAX_MEMORY_LIMIT', '512M');

WP_MEMORY_LIMIT sets memory for WordPress admin/editor, and WP_MAX_MEMORY_LIMIT sets the maximum for admin operations. Both should be the same value for Elementor.

Method 2: .htaccess (If wp-config.php doesn't work)

Add this to your .htaccess file (in the root directory):

php_value memory_limit 512M

Note: This only works if your hosting provider allows PHP directives in .htaccess. Many shared hosts don't allow this.

Method 3: php.ini (If you have access)

If you have access to php.ini, add or modify:

memory_limit = 512M

Method 4: Contact Your Host

If none of the above work, contact your hosting provider and ask them to increase the PHP memory limit for your account. Most reputable hosts will do this without issue.

Verify Memory Limit Increase

To check if the memory limit was increased, you can:

  1. Install a plugin like "WP Memory Usage" or "Query Monitor"
  2. Check your hosting control panel's PHP info
  3. Add this temporary code to your theme's functions.php (remove after checking):
    phpinfo();

Other Important PHP Settings

PHP Version

Use PHP 8.0 or higher. PHP 8.x is significantly faster than PHP 7.x, and Elementor works well with it. Check your hosting control panel to see what PHP versions are available and switch to the latest stable version (PHP 8.1 or 8.2 as of 2026).

PHP max_execution_time

Increase the maximum execution time for PHP scripts. Elementor can take longer to process complex pages:

// In wp-config.php
set_time_limit(300); // 5 minutes (300 seconds)

Or in php.ini:

max_execution_time = 300

Most hosting providers limit this, so you may need to contact them if you need higher values.

PHP post_max_size and upload_max_filesize

If you're uploading large images or assets through Elementor, increase these limits:

// In php.ini or .htaccess
post_max_size = 64M
upload_max_filesize = 64M

WordPress Configuration Optimizations

Disable Unnecessary WordPress Features

Add these to wp-config.php to reduce overhead:

// Disable WordPress file editing from admin (security + minor performance)
define('DISALLOW_FILE_EDIT', true);

// Disable automatic updates (if you manage updates manually)
define('WP_AUTO_UPDATE_CORE', false);

// Increase post revision limit (default is unlimited)
define('WP_POST_REVISIONS', 5);

// Disable trash (permanently delete posts)
define('EMPTY_TRASH_DAYS', 0); // Set to 0 to disable, or keep as 30

// Disable automatic database optimization
define('WP_ALLOW_REPAIR', false);

Optimize Database

Clean up your database regularly to remove unnecessary data:

  • Post revisions: Use a plugin like "WP-Optimize" to clean old revisions
  • Spam comments: Delete spam comments regularly
  • Transients: Clean expired transients (WP-Optimize does this)
  • Unused plugins/themes: Delete plugins and themes you're not using

Object Caching

Implement object caching to reduce database queries. Options include:

  • Redis: Best performance, requires server setup
  • Memcached: Good performance, requires server setup
  • WP Object Cache plugins: Simpler setup, works on most hosts

For shared hosting, use a plugin like "WP Redis" or "W3 Total Cache" with object caching enabled.

Elementor-Specific Optimizations

Disable Unused Elementor Features

Go to Elementor > Settings > Advanced and disable features you don't use:

  • CSS Print Method: Use "Internal Embedding" for faster loading (unless you have caching issues)
  • Disable Default Colors: If you use custom colors everywhere
  • Disable Default Fonts: If you only use custom fonts
  • Disable Elementor Generator Tag: Minor performance improvement

Optimize Elementor CSS Loading

In Elementor > Settings > Advanced:

  • Enable "CSS Print Method: Internal Embedding" for faster initial load
  • Or use "External File" if you have good caching (better for repeat visitors)
  • Avoid "Inline Embedding" as it increases HTML size

Load Font Awesome 4 Shims (If Needed)

Only enable this if you're using old Font Awesome 4 icons. If you've migrated to Font Awesome 5+, disable it in Elementor > Settings > Advanced.

Reduce Elementor Widget Count

Each Elementor widget adds CSS and JavaScript. Strategies to reduce widget count:

  • Use fewer sections/columns where possible
  • Combine similar widgets when possible
  • Use HTML/CSS widgets instead of multiple specialized widgets when appropriate
  • Avoid nesting too many containers

Caching for Elementor Sites

Page Caching

Use a caching plugin that's Elementor-compatible:

  • WP Rocket: Premium, excellent Elementor support, best overall
  • LiteSpeed Cache: Free, works great with LiteSpeed servers
  • W3 Total Cache: Free, good Elementor compatibility
  • WP Super Cache: Free, simple, decent Elementor support

Elementor CSS Caching

Most good caching plugins will cache Elementor CSS automatically. Make sure:

  • CSS minification is enabled
  • CSS combination is enabled (but test - sometimes breaks Elementor)
  • Cache is cleared when you make Elementor changes

Browser Caching

Enable browser caching for static assets. Add this to your .htaccess:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
</IfModule>

Image Optimization

Optimize images before uploading to Elementor:

  • Use WebP format: 25-35% smaller than JPEG/PNG
  • Compress images: Use tools like TinyPNG or ImageOptim before uploading
  • Use appropriate sizes: Don't upload 4000px images for 800px displays
  • Lazy load: Enable lazy loading in Elementor or via plugin

Elementor Image Settings

In Elementor, when adding images:

  • Use the appropriate image size (thumbnail, medium, large, full)
  • Enable lazy loading for images below the fold
  • Use CSS for decorative images instead of actual image widgets when possible

Using Cloudflare for Additional Performance and Security

Beyond server-side optimizations, using Cloudflare to proxy your website can provide additional performance benefits and security. Cloudflare offers free SSL certificates, DDoS protection, and CDN caching that can speed up your WordPress site. For a complete guide on setting up Cloudflare proxy, see our article on Using Cloudflare Proxy for Free SSL and DDoS Protection.

Cloudflare's CDN can cache static assets and reduce load on your origin server, which is particularly helpful for Elementor sites with lots of images and assets. The free tier includes basic DDoS protection and automatic SSL certificates.

Hosting Considerations

Shared Hosting

If you're on shared hosting and Elementor is still slow after these optimizations, consider:

  • Upgrading to a higher-tier shared hosting plan
  • Switching to managed WordPress hosting (WP Engine, Kinsta, etc.)
  • Moving to VPS hosting if you have the technical skills

Recommended Hosting Resources for Elementor

Minimum recommended resources:

  • PHP Memory: 512M+
  • PHP Version: 8.0 or higher
  • CPU: 2+ cores for busy sites
  • RAM: 2GB+ for VPS/dedicated servers

Additional Performance Tips

Minimize Plugins

Each plugin adds overhead. Only use plugins you actually need, and avoid plugins that duplicate functionality.

Use a Lightweight Theme

If you're using Elementor to build pages, use a lightweight "Elementor-friendly" theme like:

  • Hello Elementor (official, minimal)
  • Astra (popular, fast, Elementor-optimized)
  • GeneratePress (lightweight, flexible)

Optimize Font Loading

Fonts can slow down page loads:

  • Limit the number of font families you use
  • Use system fonts when possible
  • Preload critical fonts
  • Use font-display: swap in CSS

Database Optimization

Regularly optimize your database:

  • Clean up post revisions
  • Remove spam comments
  • Delete unused transients
  • Optimize database tables (via phpMyAdmin or plugin)

Testing Performance Improvements

After making changes, test your site's performance:

  • PageSpeed Insights: Google's tool for testing page speed
  • GTmetrix: Detailed performance analysis
  • Pingdom: Speed test with waterfall view
  • Elementor Editor Speed: Test how fast the Elementor editor loads

Make changes incrementally and test after each change to identify what's making the biggest difference.

Quick Checklist

Here's a quick checklist of the most important optimizations:

  1. Increase PHP memory limit to 512M (wp-config.php)
  2. Use PHP 8.0 or higher
  3. Enable page caching (WP Rocket, LiteSpeed Cache, etc.)
  4. Optimize images (WebP format, compress before upload)
  5. Use a lightweight theme (Hello Elementor, Astra, GeneratePress)
  6. Disable unused Elementor features
  7. Optimize database (clean revisions, spam, transients)
  8. Minimize plugins (only use what you need)
  9. Enable browser caching (.htaccess)
  10. Consider better hosting if still slow

Common Mistakes to Avoid

  • Setting memory limit too high: 512M-1024M is usually sufficient. Going higher rarely helps and can cause other issues.
  • Aggressive CSS/JS combination: Can break Elementor functionality. Test thoroughly.
  • Too many caching layers: Multiple caching plugins can conflict. Use one good caching solution.
  • Ignoring hosting limits: No amount of optimization will fix truly inadequate hosting.
  • Not clearing cache after changes: Always clear cache after making Elementor changes or PHP modifications.

Conclusion

Boosting Elementor speed comes down to proper PHP configuration, WordPress optimization, and smart Elementor usage. Start with increasing the PHP memory limit to 512M - that alone often solves most speed issues. Then implement caching, optimize images, and clean up your WordPress installation.

Most Elementor speed problems can be solved with these optimizations. If your site is still slow after implementing these changes, it's likely a hosting resource issue, and you should consider upgrading your hosting plan or switching to a better host.

Remember to test performance after each change, and make backups before modifying PHP settings or WordPress configuration files. With the right setup, Elementor can be fast and performant.