Shared VPS means limited CPU, RAM, I/O, and no root access. Optimization focuses on reducing server load, speeding up requests, and lowering resource usage.
1. Enable Caching (Most Effective)
Caching turns dynamic pages into static HTML to avoid repeated PHP & database processing.
- For WordPress:
Use plugins like LiteSpeed Cache, WP Rocket, W3 Total Cache, or WP Super Cache.
- Enable:
- Page caching
- Browser caching
- Object cache (if available)
- Database cache
This alone can reduce server load by 70%–90%.
2. Image Optimization
Images are usually the biggest cause of slowness.
- Compress images before upload (keep under 200KB if possible)
- Use modern formats: WebP, AVIF
- Enable lazy loading (delay offscreen images)
- Avoid uploading full-resolution images directly
3. Minify & Combine CSS/JS
- Minify: remove spaces and comments from CSS/JS files
- Combine multiple files into one to reduce HTTP requests
- Enable HTML compression
Most caching plugins can do this automatically.
4. Optimize PHP Settings
In your hosting control panel (cPanel, DirectAdmin, etc.):
- Use PHP 8.1 or higher (much faster than 7.x)
- Enable OPcache (built-in PHP acceleration)
- Set reasonable limits:
memory_limit = 128M–256Mmax_execution_time = 30
- Disable unused PHP extensions
5. Clean & Optimize Database
- Delete post revisions, spam comments, unused drafts, and transient data
- In phpMyAdmin: select all tables → Optimize Table
- Avoid heavy plugins that run frequent database queries
6. Disable Unnecessary Plugins / Scripts
Too many plugins are the #1 cause of high load on shared VPS.
- Deactivate and delete unused plugins/themes
- Avoid heavy themes with built-in sliders, widgets, and complex scripts
- Stop auto-saving, frequent heartbeats, and background updates
For WordPress:
Disable the default wp-cron to reduce CPU usage:
php
运行
define('DISABLE_WP_CRON', true);
Set a real cron job instead (every 15–30 minutes).
7. Use a CDN
A CDN serves static files (images, CSS, JS) from global nodes, greatly reducing your VPS load.
Recommended free options:
- Cloudflare
Enable:
- Auto minify
- Browser cache rules
- Image optimization
- DDoS and bot protection
8. Block Bots & Malicious Traffic
- Use Cloudflare firewall to block bad bots, scrapers, and brute-force attacks
- Limit access to wp-admin, XML-RPC, etc.
- Block unnecessary crawlers that waste resources
9. Use Lightweight Themes
Avoid heavy, bloated themes.
Fast alternatives: Astra, GeneratePress, Kadence, Storefront.
10. Fix Hotlinking
Prevent other websites from loading your images and wasting your bandwidth.
You can add rules in
.htaccess or enable hotlink protection in Cloudflare.Quick Optimization Checklist
- Use a caching plugin
- Enable Cloudflare CDN
- Compress all images to WebP
- Update to PHP 8.1+
- Minify CSS/JS/HTML
- Optimize & clean the database
- Reduce plugins to a minimum
- Use a lightweight theme
After these steps, your shared VPS will perform significantly better even with high traffic.
