How to Speed Up Your cPanel Hosting Website Fast
By Yoga · 29 May 2026 · 2 min read
If your website feels sluggish, the problem often lives inside your hosting environment — not just your theme or plugins. The good news is that cPanel gives you direct access to several performance levers that most people never touch. This guide walks you through concrete, actionable steps to speed up your cPanel hosting website without needing to touch a single line of server config as root.
1. Upgrade to the Latest Stable PHP Version
PHP is the engine behind most websites on shared hosting. Running an outdated version — say PHP 7.2 or 7.4 — leaves significant performance on the table compared to PHP 8.1 or 8.2.
Why it matters
Every major PHP release includes engine-level optimizations. PHP 8.x introduced the JIT (Just-In-Time) compiler, which can improve CPU-heavy operations by 30–50% in real-world benchmarks. Beyond speed, newer versions also receive security patches.
How to change PHP version in cPanel
- Log in to cPanel.
- Navigate to Software → Select PHP Version (sometimes called MultiPHP Manager or PHP Selector depending on your host).
- Choose PHP 8.1 or 8.2 from the dropdown.
- Click Apply or Set as current.
- Test your site immediately — some older plugins may need updates to stay compatible.
Tip: If you run WordPress, check the plugin compatibility list before upgrading. Most plugins have supported PHP 8.x since 2022.
2. Enable OPcache for PHP Bytecode Caching
Every time PHP processes a .php file, it compiles the source code into bytecode. Without caching, this happens on every single request. OPcache stores compiled bytecode in memory so the compilation step is skipped on subsequent requests.
Enabling OPcache in cPanel
- Go to Software → Select PHP Version.
- Click the Extensions tab (or switch to the PHP extensions view).
- Find
opcachein the list and toggle it on. - Save changes.
Verifying OPcache is active
Create a temporary PHP file on your server:
<?php
phpinfo();
Load it in your browser and search for opcache. You should see a section confirming it is enabled with memory consumption and hit rate stats.
Recommended OPcache settings (via .htaccess or php.ini)
If your host allows a custom php.ini or .user.ini, these values are a solid starting point for a medium-traffic site:
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
Adjust memory_consumption upward (e.g., 256) if you have a large application with many PHP files.
3. Optimize MySQL Queries and Enable Query Caching
Slow database queries are a hidden bottleneck. Even a well-coded site can grind to a halt if the database is doing unnecessary work.
Identify slow queries using cPanel's phpMyAdmin
- Open Databases → phpMyAdmin in cPanel.
- Select your database.
- Click the Status tab and look at Slow queries.
- For WordPress, also check the wp_options table — a bloated autoloaded options table is one of the most common culprits.
To see the autoloaded data size in WordPress, run this SQL query in phpMyAdmin:
SELECT
SUM(LENGTH(option_value)) AS autoload_size
FROM wp_options
WHERE autoload = 'yes';
If the result is above ~800 KB, you have excess autoloaded data slowing down every page load.
Clean up the database
- Delete post revisions, spam comments, and transients using a plugin like WP-Optimize or the following SQL:
-- Delete post revisions
DELETE FROM wp_posts WHERE post_type = 'revision';
-- Delete expired transients
DELETE FROM wp_options
WHERE option_name LIKE '%_transient_%'
AND option_value < UNIX_TIMESTAMP();
- Add indexes to columns you frequently filter by. For custom tables, this alone can reduce query time by 10x.
Consider a persistent object cache
If your cPanel plan includes Redis or Memcached (some managed plans do), connect your WordPress installation to it via a plugin like Redis Object Cache. This keeps frequently-read database results in memory, bypassing MySQL entirely for repeat reads.
4. Compress and Lazy-Load Images
Images typically account for 50–80% of a web page's total byte size. Compressing them before upload — and deferring off-screen images — is one of the highest-impact changes you can make.
Format comparison
| Format | Best For | Avg. Size vs. JPEG |
|---|---|---|
| JPEG | Photos, gradients | Baseline |
| PNG | Logos, transparency | Larger |
| WebP | Everything | ~25–35% smaller |
| AVIF | Modern browsers | ~40–50% smaller |
Compressing images via cPanel's File Manager
cPanel itself does not include a built-in image optimizer, but you can use the terminal (if SSH or the Terminal tool is available) to batch-compress images:
# Install cwebp if not present (on servers where you have shell access)
# Convert all JPEGs in a folder to WebP
for f in public_html/wp-content/uploads/*.jpg; do
cwebp -q 82 "$f" -o "${f%.jpg}.webp"
done
For a no-command-line approach, the Imagify, ShortPixel, or Squoosh (web app) tools integrate with WordPress and automatically serve WebP to supported browsers.
Enable lazy loading
Modern browsers support native lazy loading. For WordPress, simply add this to your functions.php:
add_filter( 'wp_lazy_loading_enabled', '__return_true' );
WordPress 5.5+ has this enabled by default. Confirm by inspecting an image element — it should have loading="lazy" as an attribute.
5. Use .htaccess for Browser Caching and GZIP Compression
These two .htaccess rules reduce the amount of data transferred on every request.
Enable GZIP compression
Add this block to your .htaccess file (edit it via File Manager → public_html → .htaccess):
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/javascript
AddOutputFilterByType DEFLATE application/javascript application/json
AddOutputFilterByType DEFLATE image/svg+xml application/xml
</IfModule>
Enable browser caching
<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"
ExpiresByType text/html "access plus 1 hour"
</IfModule>
These rules tell the visitor's browser to cache static files locally, so repeat visits skip re-downloading assets they already have.
6. Reduce HTTP Requests with Minification
Every CSS file, JavaScript file, and web font is a separate HTTP request. Combining and minifying these files reduces round trips to the server.
For WordPress users
Install a plugin such as Autoptimize or LiteSpeed Cache (if your host runs LiteSpeed). Configure it to:
- Minify and combine CSS files.
- Minify and defer non-critical JavaScript.
- Remove unused CSS (use with caution — test thoroughly).
For non-WordPress or custom sites
Use a build tool like Vite, Webpack, or esbuild to bundle and minify assets during your deployment pipeline. The output should be a single (or a small number of) minified .css and .js files.
Putting It All Together: A Quick Audit Checklist
Before and after applying these changes, measure your site with Google PageSpeed Insights or GTmetrix so you can see concrete improvements.
- PHP version is 8.1 or higher
- OPcache is enabled and showing a high hit rate
- Database autoloaded data is under 800 KB
- All images are served in WebP or AVIF format
- Lazy loading is active on images
- GZIP compression is confirmed (check response headers:
Content-Encoding: gzip) - Browser caching headers are set for static assets
- CSS and JS files are minified
If your shared hosting plan is consistently maxing out its resources even after these optimizations, it may be time to consider a VPS or a higher-tier plan that gives you more control over server-level tuning. Providers like GoCelerus offer cPanel shared hosting plans and VPS options if you need room to grow.
Final Thoughts
Speeding up a cPanel hosting website is less about magic tools and more about removing unnecessary work at each layer: PHP compilation (OPcache), database queries (indexes and object caching), asset size (image compression and minification), and network transfers (GZIP and browser caching). Apply each fix systematically, measure before and after, and you will see real, measurable improvements in both load time and Google Core Web Vitals scores.