Blog · 1 Sep 2026 · 6 min read
How to Speed Up Your cPanel Hosting Website Effectively
Learn practical cPanel optimizations to make your website faster — from upgrading PHP and enabling OPcache to tuning MySQL caching and compressing images step by step.
By Yoga
Slow websites lose visitors. Research consistently shows that a one-second delay in page load time can drop conversions by several percentage points. If your site runs on cPanel shared hosting, the good news is that you have more control over performance than most people realize — without needing root server access.
This guide walks you through concrete, actionable steps to speed up your cPanel hosting website. No vague advice — only changes you can actually make inside your cPanel dashboard or your CMS.
1. Upgrade to a Modern PHP Version
PHP is the engine behind most dynamic websites. Running an outdated PHP version is one of the single biggest performance bottlenecks on shared hosting.
Why PHP Version Matters
Each major PHP release brings significant speed improvements:
| PHP Version | Relative Speed | Status |
|---|---|---|
| PHP 7.4 | Baseline | End of Life |
| PHP 8.0 | ~10% faster than 7.4 | End of Life |
| PHP 8.1 | ~15% faster than 7.4 | Security fixes only |
| PHP 8.2 | ~18% faster than 7.4 | Active support |
| PHP 8.3 | ~20%+ faster than 7.4 | Active support |
Moving from PHP 7.4 to 8.2+ alone can shave hundreds of milliseconds off server response time.
How to Change PHP Version in cPanel
- Log in to your cPanel account.
- Navigate to Software → Select PHP Version (sometimes labeled "MultiPHP Manager").
- Select your domain from the list.
- Choose the highest PHP version your application supports.
- Click Apply.
Before switching: Test on a staging environment. Some older plugins or themes may not be fully compatible with PHP 8.x. Check for deprecated function warnings first.
2. Enable and Configure OPcache
OPcache is a built-in PHP extension that stores precompiled script bytecode in memory. Instead of parsing and compiling your PHP files on every single request, the server reuses cached bytecode — dramatically reducing CPU work.
Enabling OPcache in cPanel
In many cPanel environments, OPcache can be toggled per account:
- Go to Software → Select PHP Version.
- Click the Extensions tab.
- Scroll to find
opcacheand tick the checkbox to enable it. - Save your changes.
Tuning OPcache via .htaccess or php.ini
If your host allows a custom php.ini (look for the PHP INI Editor in cPanel), add or adjust these directives:
; Enable OPcache
opcache.enable=1
; Amount of shared memory (in MB) for storing precompiled PHP code
opcache.memory_consumption=128
; Maximum number of files that can be cached
opcache.max_accelerated_files=10000
; How often (in seconds) PHP checks for updated scripts. Set to 0 in production for max speed.
opcache.revalidate_freq=60
; Cache interned strings
opcache.interned_strings_buffer=16
; Enable fast shutdown
opcache.fast_shutdown=1
On a busy WordPress site, enabling OPcache alone can reduce Time to First Byte (TTFB) by 30–50%.
3. Optimize MySQL Query Caching and Database Performance
Slowly executed database queries are a silent killer for dynamic sites. Every page load on a WordPress, Joomla, or Drupal site often triggers dozens of MySQL queries.
Check Your Slow Query Log
If your host exposes MySQL access (via phpMyAdmin in cPanel), you can identify slow queries:
-- Show queries taking more than 1 second
SELECT * FROM information_schema.PROCESSLIST
WHERE TIME > 1
ORDER BY TIME DESC;
Add Database Indexes Where Missing
Unindexed tables cause full table scans on every query. For WordPress:
-- Example: Add an index to the post_status column in wp_posts
ALTER TABLE wp_posts ADD INDEX post_status_index (post_status);
Plugins like Query Monitor (WordPress) can surface which queries are slow without needing direct SQL access.
Use a WordPress Object Cache with Transients
For WordPress sites on shared hosting, using the Transients API or a persistent object cache plugin reduces redundant queries:
- WP Transient stores expensive query results temporarily in the database.
- Plugins like W3 Total Cache or WP Super Cache can enable database caching layers even without Redis or Memcached access.
Clean Up the Database Regularly
Over time, WordPress databases accumulate overhead from post revisions, spam comments, expired transients, and orphaned metadata. Use WP-Optimize or run:
-- Remove post revisions
DELETE FROM wp_posts WHERE post_type = 'revision';
-- Remove expired transients
DELETE FROM wp_options
WHERE option_name LIKE '%_transient_%'
AND option_value < UNIX_TIMESTAMP(NOW());
-- Optimize all tables
OPTIMIZE TABLE wp_posts, wp_options, wp_postmeta;
Run these on a backup first. Always.
4. Compress and Serve Images Efficiently
Images routinely account for 50–80% of a page's total download size. Optimizing them is the highest-impact front-end change you can make.
Convert Images to Modern Formats
WebP images are typically 25–35% smaller than equivalent JPEGs at the same visual quality. Most modern browsers support WebP.
If you manage your own files via cPanel File Manager, you can convert images using command-line tools if shell access is available:
# Convert a JPEG to WebP using cwebp
cwebp -q 80 original.jpg -o optimized.webp
# Batch convert all JPEGs in a directory
for f in *.jpg; do cwebp -q 80 "$f" -o "${f%.jpg}.webp"; done
For WordPress without shell access, plugins like Imagify, ShortPixel, or Smush handle conversion and compression automatically through their APIs.
Enable Gzip Compression via .htaccess
Gzip compresses text-based assets (HTML, CSS, JS) before they are sent to the browser. Add this to your .htaccess file (accessible via File Manager in cPanel):
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilterByType DEFLATE text/css application/javascript
AddOutputFilterByType DEFLATE application/json application/xml
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
Set Browser Cache Headers
Tell browsers to store static files locally so repeat visitors load pages faster:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
5. Verify Your Results with Real Benchmarking Tools
Changes should be measured, not assumed. Use these free tools after each optimization:
- Google PageSpeed Insights — Measures Core Web Vitals (LCP, CLS, FID/INP) and gives actionable recommendations.
- GTmetrix — Shows waterfall charts so you can see exactly which assets are slowest.
- WebPageTest.org — Allows you to test from specific geographic locations, useful for Southeast Asian audience targeting.
- Pingdom Tools — Simple TTFB and load time tracking.
Run tests before and after each change. Optimization without measurement is guesswork.
Putting It All Together: A Quick Priority Checklist
If you're short on time, tackle these in order of impact:
- ✅ Upgrade PHP to 8.2 or 8.3 — Biggest backend speed gain, takes 2 minutes.
- ✅ Enable OPcache — Reduces PHP compile time on every request.
- ✅ Compress and convert images to WebP — Biggest front-end bandwidth saving.
- ✅ Enable Gzip and browser caching via
.htaccess— Faster repeat visits and reduced transfer size. - ✅ Clean up your database and add missing indexes — Reduces query time on dynamic pages.
Choosing Hosting That Supports These Optimizations
Not all shared hosting providers give you access to the PHP version selector, OPcache configuration, or .htaccess override support. When evaluating hosting, confirm that the provider offers:
- MultiPHP Manager or equivalent PHP version switching
- PHP INI editor or per-directory
php.inisupport - OPcache available as a PHP extension
- Apache
mod_deflateandmod_expiresenabled
If you're already on cPanel-based shared hosting — such as plans offered by GoCelerus — many of these features are available directly from the cPanel dashboard without needing to contact support.
With the right host and the optimizations in this guide applied, you should see meaningful improvements in TTFB, page load time, and Google's Core Web Vitals scores — all of which contribute to better search rankings and a smoother experience for your visitors.