How to Speed Up Your cPanel Hosting Website Fast
By Yoga · 25 Aug 2026 · 6 min read
Slow websites bleed traffic. A one-second delay in page load time can drop conversions by up to 7%, and Google factors Core Web Vitals directly into search rankings. If your site runs on cPanel shared hosting, you have more performance levers to pull than most people realize — no server admin degree required.
This guide walks through concrete, step-by-step optimizations you can apply inside cPanel today.
1. Upgrade to the Newest Stable PHP Version
PHP version choice is the single highest-impact change you can make without touching a line of code. Each major PHP release brings measurable performance improvements:
| PHP Version | Relative Speed vs PHP 5.6 |
|---|---|
| 5.6 | Baseline (slow) |
| 7.4 | ~3× faster |
| 8.1 | ~4× faster |
| 8.2 / 8.3 | ~4.5× faster |
How to switch PHP version in cPanel
- Log in to cPanel and search for Select PHP Version (MultiPHP Manager).
- Choose your domain from the dropdown.
- Select PHP 8.2 (or the latest stable version your plugins support).
- Click Apply.
Before switching: Test your site on a staging environment or check plugin/theme compatibility first. Most modern WordPress plugins support PHP 8.x without issues.
2. Enable PHP OPcache
Every time PHP processes a script, it compiles the source code into bytecode. OPcache stores that compiled bytecode in shared memory, so PHP skips the compile step on subsequent requests. The result is dramatically lower CPU usage and faster response times — often a 30–50% improvement on PHP-heavy sites.
Enabling OPcache inside cPanel
- In cPanel, go to Select PHP Version → PHP Extensions.
- Scroll down and tick the opcache checkbox.
- Click Save.
Tuning OPcache via .htaccess or php.ini
Once enabled, the default settings are conservative. Add these directives to your php.ini (via cPanel's PHP INI Editor) for better performance:
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
memory_consumption=128— allocates 128 MB for the bytecode cache. Increase to 256 if you run a large application.max_accelerated_files=10000— caches up to 10,000 scripts. WordPress plus plugins can easily have 5,000+ files.revalidate_freq=60— checks for file changes every 60 seconds instead of on every request.
3. Optimize MySQL / MariaDB Queries
Database slowness is often the invisible culprit behind high Time to First Byte (TTFB). cPanel hosting uses MySQL or MariaDB under the hood, and there are several things you can do at the application level without touching the database server config.
Enable the WordPress Object Cache (if you use WordPress)
WordPress fires multiple database queries on every page load by default. A persistent object cache stores query results in memory (using Redis or Memcached if your host provides it, or a file-based cache as fallback).
Install and activate a plugin like W3 Total Cache or WP Rocket, then enable the Object Cache option. This can cut repeated database queries to near zero.
Identify slow queries with the Slow Query Log
If you have access to MySQL via cPanel's phpMyAdmin, run this query to spot the worst offenders:
SELECT
query_time,
sql_text
FROM
mysql.slow_log
ORDER BY
query_time DESC
LIMIT 10;
You may need to ask your host to enable the slow query log, but many shared hosts expose it through cPanel's MySQL Databases panel.
Add indexes to frequently queried columns
If you have a custom database table and a query like:
SELECT * FROM orders WHERE customer_email = '[email protected]';
...and customer_email has no index, MySQL performs a full table scan. Adding an index is a one-liner:
ALTER TABLE orders ADD INDEX idx_customer_email (customer_email);
For WordPress, plugins like Query Monitor (free) show you exactly which queries are slow and where they originate in the code.
4. Compress and Serve Images Correctly
Images typically account for 50–70% of a page's total weight. Compressing them before upload and serving them in modern formats is one of the most impactful front-end optimizations.
Convert images to WebP
WebP images are 25–35% smaller than equivalent JPEGs at the same visual quality. You can convert images:
- Locally before uploading: tools like Squoosh (browser-based) or
cwebp(command-line) work well. - Automatically via plugin (WordPress): ShortPixel or Imagify convert and serve WebP with no manual work.
Enable Gzip / Brotli compression in cPanel
cPanel's Apache server supports Gzip compression out of the box. Enable it by adding the following to your .htaccess file:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilterByType DEFLATE text/css text/javascript
AddOutputFilterByType DEFLATE application/javascript application/json
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
This compresses HTML, CSS, JS, and SVG responses before they travel over the wire — typically reducing transfer size by 60–80% for text-based assets.
Set browser caching headers
Tell browsers to cache static assets (images, CSS, JS) locally so repeat visitors don't re-download them:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "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"
</IfModule>
Add this to .htaccess directly through cPanel's File Manager or via SFTP.
5. Use cPanel's Built-In Caching Tools
Some cPanel-based hosting environments include LiteSpeed Web Server or have caching modules installed. Check under Software in cPanel for:
- LiteSpeed Cache — if your host runs LiteSpeed, install the free LiteSpeed Cache plugin for WordPress. It integrates directly with the server-level cache, which is far more efficient than application-level caching alone.
- Cloudflare Integration — cPanel often includes a native Cloudflare section. Enabling Cloudflare from within cPanel activates a CDN and DDoS protection with a few clicks. Make sure to set caching level to Standard and enable Auto Minify for JS, CSS, and HTML in the Cloudflare dashboard after connecting.
6. Minify CSS, JavaScript, and HTML
Minification strips whitespace, comments, and redundant characters from your code files without changing how they work. A typical WordPress site can shed 10–20% of its HTML/CSS/JS weight through minification alone.
Via .htaccess (Apache mod_deflate already helps, but for explicit minification):
For WordPress sites, plugins handle this best:
- Autoptimize (free) — aggregates and minifies CSS and JS.
- WP Rocket (paid) — combines minification, lazy loading, and database optimization in one tool.
For non-WordPress sites, use a build tool like Vite, esbuild, or Webpack to minify assets before deploying.
7. Audit Your Hosting Plan Itself
No amount of optimization fully compensates for a severely under-resourced plan. Signs you've hit the ceiling:
- TTFB consistently above 800 ms even after caching is enabled
- CPU or memory limits in cPanel's Resource Usage (Awstats / CPU & Concurrent Connection Usage) are regularly maxed out
- Your host throttles your processes during peak hours
At that point, moving from shared to a VPS or cloud hosting plan gives you dedicated resources, root access to tune MySQL server variables (like innodb_buffer_pool_size), and the ability to install server-level caches like Redis directly.
Quick-Reference Checklist
- Upgrade PHP to 8.2 or latest stable
- Enable and tune OPcache via PHP INI editor
- Activate an object cache plugin (WordPress)
- Identify and index slow database queries
- Convert images to WebP and compress before upload
- Add Gzip compression to
.htaccess - Set long browser cache expiry headers
- Minify CSS, JS, and HTML
- Check for LiteSpeed or Cloudflare integration in cPanel
- Monitor resource usage and consider upgrading if limits are maxed
If you're looking for cPanel hosting that gives you the flexibility to apply all of these optimizations without artificial restrictions, GoCelerus offers shared and WordPress hosting plans built for performance — a solid starting point before you need to step up to a VPS.
Speed is not a one-time fix. Re-run a tool like Google PageSpeed Insights or GTmetrix after each change, measure the before/after delta, and iterate. Small, compounding improvements add up fast.