You don't need a powerful VPS to run WordPress. With the right optimizations, a 1‑2 GB RAM VPS can handle thousands of daily visitors. This guide covers practical tips.
1. Choose a Lightweight Theme
Many popular themes (e.g., Avada, Divi) are bloated. Consider lightweight alternatives:
- GeneratePress (free version available)
- Kadence (free version)
- Blocksy (free version)
- Twenty Twenty‑Five (default WordPress theme, surprisingly fast)
2. Use a Caching Plugin
Caching reduces server load. Generate static HTML files from dynamic PHP.
Recommended free plugins:
- WP Super Cache (easy, good for beginners)
- W3 Total Cache (more options)
- LiteSpeed Cache (if using LiteSpeed server)
Enable page caching, browser caching, and minify CSS/JS. For WP Super Cache, select “Simple” or “Expert” mode.
3. Optimize Images
Images are usually the largest files on a page. Compress them without losing quality:
- ShortPixel (free tier: 100 images/month)
- Imagify (free tier)
- EWWW Image Optimizer (free)
Also convert images to WebP format (many plugins can do this).
4. Use a Content Delivery Network (cdn)
A CDN offloads static files (images, CSS, JS) to edge servers. Free options:
- Cloudflare (free tier includes CDN and DDoS protection)
- Bunny.net (free trial, low cost)
Configure CDN to serve your static assets, reducing bandwidth on your VPS.
5. Optimize Database
WordPress database accumulates post revisions, transients, and spam comments. Clean it up:
- WP Optimize (free) – cleans database and compresses images
- Advanced Database Cleaner (free)
Run once a month to keep database size small.
6. Enable PHP OpCache
OpCache stores compiled PHP scripts in memory, reducing CPU usage.
Check if enabled via phpinfo(). On Ubuntu, install:
sudo apt install php8.2-opcache
Then edit php.ini:
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=4000
Restart PHP‑FPM.
7. Use Redis for Object Caching
Redis stores database query results in memory. Install Redis server:
sudo apt install redis-server php8.2-redis -y
Then install Redis Object Cache plugin in WordPress and enable it. This reduces database queries significantly.
8. Disable Unnecessary Features
In WordPress, disable or remove:
- Post revisions (limit to 2‑3)
- Pingbacks and trackbacks
- Emojis (unless needed)
- XML‑RPC (unless using Jetpack or mobile apps)
Add to wp-config.php:
define('WP_POST_REVISIONS', 3);
define('WP_CRON_LOCK_TIMEOUT', 60);
9. Switch to PHP 8.x
PHP 8.x is significantly faster than PHP 7.x. Use PHP 8.2 or 8.3. Check your hosting panel or upgrade manually.
Verify compatibility with your theme and plugins before upgrading.
10. Monitor Resource Usage
Use tools to identify bottlenecks:
- Query Monitor – shows slow queries, PHP errors
- Server IP & Memory Usage – lightweight dashboard
Also install htop on your VPS to check CPU and RAM in real time.
Next Steps
After applying these optimizations, test your site's speed with Google PageSpeed Insights or GTmetrix. You should see noticeable improvements even on a low‑end VPS.
Need a VPS to practice on? Check our recommended VPS providers.