Public Beta — use code LAUNCH15 for 15% off any plan
Back to blog

How to Speed Up cPanel Hosting: Practical Optimizations

By Yoga · 21 Jul 2026 · 2 min read

How to Speed Up cPanel Hosting: Practical Optimizations

Why Website Speed Still Matters in Shared Hosting

Page load time directly affects your bounce rate, search rankings, and conversion rate. Google's Core Web Vitals make performance a measurable ranking factor, yet many site owners overlook the low-hanging fruit hiding inside their cPanel dashboard.

Shared hosting does have resource limits, but that doesn't mean your site has to feel slow. With the right server-side tweaks, you can dramatically cut your Time to First Byte (TTFB) and page load time — without migrating to a VPS or paying for expensive add-ons.

This guide walks through four concrete optimization areas: PHP configuration, OPcache, MySQL query caching, and image compression. Each section includes actionable steps you can do today.


1. Upgrade to the Latest Stable PHP Version

This is the single highest-impact change most shared hosting users never make. PHP 8.2 and 8.3 process requests roughly 2–3× faster than PHP 5.6 or 7.0, thanks to a redesigned JIT compiler and memory improvements.

How to Change Your PHP Version in cPanel

  1. Log in to cPanel.
  2. Navigate to Software → Select PHP Version (sometimes labeled MultiPHP Manager).
  3. Choose the latest stable release (PHP 8.2 or higher recommended as of 2024).
  4. Click Apply and test your site immediately.

Before switching: make a full backup and check your theme/plugin compatibility. Most modern WordPress plugins support PHP 8.x, but legacy code may throw deprecation errors.

Fine-Tune php.ini for Performance

After upgrading, go to Software → PHP INI Editor and adjust these values:

; Reduce memory waste on small scripts
memory_limit = 256M

; Prevent runaway scripts from hogging CPU
max_execution_time = 60

; Larger upload limit only if you actually need it
upload_max_filesize = 64M
post_max_size = 64M

; Keep sessions in memory, not disk (if host allows)
session.save_handler = files

Keep memory_limit realistic — setting it to 512 M or higher on shared hosting wastes quota and can trigger per-process limits.


2. Enable and Configure OPcache

Every time PHP serves a page, it normally compiles your .php source files into bytecode. OPcache stores that compiled bytecode in memory so subsequent requests skip the compilation step entirely. The result: 50–80% faster PHP execution on repeated requests with near-zero effort.

Check Whether OPcache Is Active

Create a quick diagnostic file in your public directory:

<?php
// Save as opcache-check.php — DELETE after checking!
$status = opcache_get_status();
echo '<pre>';
print_r($status);
echo '</pre>';

Visit yourdomain.com/opcache-check.php. Look for "opcache_enabled" => true. If it reads false, contact your host to enable the opcache PHP extension.

Recommended OPcache Settings

In your PHP INI Editor (or a custom .user.ini in your document root), add:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.save_comments=1
Setting Recommended Value Why
memory_consumption 128 MB Holds compiled bytecode for large apps
max_accelerated_files 10 000 Enough for WordPress + plugins
revalidate_freq 60 seconds Balances cache freshness vs. performance
save_comments 1 Required by Doctrine/annotations

WordPress users: after updating a plugin or theme, OPcache may serve stale bytecode. Install a plugin like OPcache Manager or add a wp-cli command to flush the cache on deploy.


3. Optimize MySQL for Faster Database Queries

For WordPress, WooCommerce, or any CMS, most page-load time is spent waiting for database queries. You can't change MySQL server settings on shared hosting, but you can optimize the queries and data your application sends.

Identify Slow Queries First

If your host provides phpMyAdmin, run this query to find tables that haven't been optimized recently:

SELECT table_name, data_free
FROM information_schema.tables
WHERE table_schema = 'your_database_name'
  AND data_free > 0
ORDER BY data_free DESC;

High data_free values mean fragmented tables. Reclaim that space with:

OPTIMIZE TABLE wp_options;
OPTIMIZE TABLE wp_postmeta;

Reduce Autoloaded Data in wp_options

WordPress loads every row in wp_options marked autoload = yes on every single page request. Plugin bloat can push this above 2 MB, adding 200–400 ms of overhead.

-- Find the total size of autoloaded data
SELECT SUM(LENGTH(option_value)) AS autoload_size
FROM wp_options
WHERE autoload = 'yes';

-- List the biggest offenders
SELECT option_name, LENGTH(option_value) AS size
FROM wp_options
WHERE autoload = 'yes'
ORDER BY size DESC
LIMIT 20;

If autoload_size exceeds 800 KB, investigate which plugins are storing large transients or configuration blobs and consider disabling or replacing them.

Enable a WordPress Object Cache

On cPanel hosting that provides Memcached or Redis (check under Software or ask your host), install the corresponding WordPress drop-in:

  • Redis: use the Redis Object Cache plugin and set WP_REDIS_HOST in wp-config.php.
  • Memcached: use W3 Total Cache or WP Object Cache with Memcached backend.

Without a persistent object cache, WordPress re-runs the same database queries for every visitor. With one enabled, query results are served from RAM.


4. Compress and Optimize Images Server-Side

Images are typically 60–80% of a page's total weight. Uploading a 4 MB JPEG from your phone and serving it as-is is the fastest way to kill your PageSpeed score.

Convert and Compress via cPanel File Manager

cPanel itself doesn't resize images, but you can use the Terminal (if available) or an .htaccess trick combined with a WordPress plugin.

Option A — WordPress plugin approach:

  • Install Imagify, ShortPixel, or Smush to bulk-compress existing images and auto-compress on upload.
  • These plugins use external APIs; your server CPU stays free.

Option B — Server-side via Terminal:

# Install pngquant and jpegoptim if your host allows custom binaries
# Or use the pre-installed convert (ImageMagick)

# Resize all JPEGs wider than 1920px to max 1920px width
find ~/public_html/wp-content/uploads -name '*.jpg' | while read f; do
  convert "$f" -resize '1920x>' "$f"
done

# Strip metadata and reduce quality to 82%
find ~/public_html/wp-content/uploads -name '*.jpg' -exec \
  convert {} -strip -quality 82 {} \;

Serve Modern Formats with .htaccess

If your server has the mod_rewrite and WebP support compiled in, you can serve .webp versions automatically to browsers that support them:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_ACCEPT} image/webp
  RewriteCond %{REQUEST_FILENAME} \.(jpe?g|png)$
  RewriteCond %{REQUEST_FILENAME}.webp -f
  RewriteRule ^(.+)\.(jpe?g|png)$ $1.$2.webp [T=image/webp,E=accept:1,L]
</IfModule>

<IfModule mod_headers.c>
  Header append Vary Accept env=REDIRECT_accept
</IfModule>

AddType image/webp .webp

Pre-generate .webp files using a plugin (Imagify, ShortPixel) or the cwebp CLI tool if available in your cPanel Terminal.


Putting It All Together: Quick Reference Checklist

Task Where in cPanel Impact
Upgrade to PHP 8.2+ Software → MultiPHP Manager High
Enable OPcache Software → PHP INI Editor High
Optimize MySQL tables phpMyAdmin → SQL tab Medium
Reduce autoloaded wp_options phpMyAdmin → SQL tab Medium–High
Enable Redis/Memcached object cache Software (ask host) High
Bulk compress images Plugin or Terminal High
Serve WebP images .htaccess Medium

Work through this list top-to-bottom. The PHP and OPcache changes alone often reduce TTFB by 30–50% on a fresh WordPress install.


Final Thoughts

Speeding up a cPanel hosting site isn't about buying more resources — it's about using existing resources efficiently. A PHP version upgrade costs nothing. OPcache is usually already installed and just needs enabling. MySQL table optimization takes under five minutes in phpMyAdmin.

If you're already on a host that supports PHP 8.x, OPcache, and optionally Redis, you have everything you need to build a fast site. GoCelerus cPanel hosting is one option worth exploring if you need a starting point with these features available out of the box.

Start with the checklist above, measure your results in Google PageSpeed Insights or GTmetrix before and after each change, and only add more infrastructure (CDN, VPS, etc.) once you've maxed out what the server itself can do.

Welcome to GoCelerus

Save 15% on any plan

Launch promo — 15% off any plan

Your coupon code

LAUNCH15
Browse plans