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

How to Speed Up Your cPanel Hosting Website Effectively

By Yoga · 07 Jul 2026 · 6 min read

How to Speed Up Your cPanel Hosting Website Effectively

If your website feels sluggish, the fix often lives inside your cPanel dashboard — not in some expensive server upgrade. Most shared hosting environments give you more performance controls than people realize. This guide walks you through concrete, proven techniques to speed up a cPanel-hosted website, with enough detail that you can actually follow through.

1. Upgrade to the Latest Stable PHP Version

This is the single highest-impact change most cPanel users never make. PHP 8.x is significantly faster than PHP 7.4 and dramatically faster than PHP 5.6 — yet plenty of websites still run on outdated versions because no one changed the default.

How to Change PHP Version in cPanel

  1. Log in to cPanel and search for MultiPHP Manager (or Select PHP Version depending on your host's setup).
  2. Select your domain from the list.
  3. Choose the latest stable PHP version (PHP 8.2 or 8.3 at the time of writing).
  4. Click Apply.

Before switching on a live site, test in a staging environment if possible. Most modern WordPress plugins and themes support PHP 8.x, but a small number of legacy add-ons may need updates first.

Why it matters: PHP 8.0 introduced the JIT (Just-In-Time) compiler. Benchmarks consistently show 20–40% throughput improvements over PHP 7.4 for typical CMS workloads. That translates directly into faster page generation times.

2. Enable and Configure OPcache

Every time PHP executes a script, it compiles the source code into opcodes. Without caching, this compilation happens on every single request. OPcache stores the compiled opcodes in shared memory so PHP skips the compilation step entirely on subsequent requests.

Enabling OPcache via cPanel MultiPHP INI Editor

  1. In cPanel, open MultiPHP INI Editor.
  2. Switch to Editor Mode and select your domain.
  3. Add or verify the following settings:
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
  1. Click Save.

What These Settings Mean

Setting Recommended Value Purpose
opcache.memory_consumption 128 (MB) RAM allocated for cached opcodes
opcache.max_accelerated_files 10000 Max scripts that can be cached
opcache.revalidate_freq 60 (seconds) How often to check for script changes
opcache.interned_strings_buffer 8 (MB) Memory for interned strings

For a WordPress site with many plugins, bump max_accelerated_files to 20000 if you notice cache misses. You can check OPcache stats with a small PHP script or a plugin like OPcache Manager for WordPress.

3. Tune MySQL / MariaDB Query Caching

Database queries are often the hidden bottleneck. cPanel servers typically run MariaDB, and a few configuration tweaks can make a measurable difference in query response time.

What You Can Control as a Shared Hosting User

On shared hosting you usually cannot edit my.cnf directly, but you can still optimize at the application level:

For WordPress users:

  • Install a persistent object cache. The most practical option on shared hosting is Memcached or Redis if your host exposes it, or a file-based object cache drop-in if not.
  • Use a caching plugin (W3 Total Cache, WP Super Cache, or LiteSpeed Cache) that stores full-page HTML so MySQL is bypassed entirely for anonymous visitors.

Slow query identification: Add this to wp-config.php temporarily to log slow queries:

define( 'SAVEQUERIES', true );

Then use the Query Monitor plugin to inspect which queries are slow. Once identified, adding a database index (via phpMyAdmin in cPanel) to the relevant column can cut query time from hundreds of milliseconds to single digits.

Using phpMyAdmin to Add an Index

  1. Open phpMyAdmin from cPanel.
  2. Select your database, then the slow table.
  3. Click the Structure tab.
  4. Find the column that appears in your WHERE clause most often (e.g., post_status, post_type for WordPress).
  5. Click Index next to that column.

This is especially useful for WooCommerce stores where the wp_postmeta table grows large and unindexed lookups become painful.

4. Compress and Optimize Images Through cPanel

Images account for 50–80% of a typical page's total byte size. Serving uncompressed images is one of the most common — and most fixable — performance problems.

Enabling Compression at the Server Level (.htaccess)

In cPanel, open the File Manager, navigate to your public_html directory, and edit (or create) .htaccess. Add the following block to enable Gzip compression for text-based assets:

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml
  AddOutputFilterByType DEFLATE text/css application/javascript
  AddOutputFilterByType DEFLATE application/json application/xml
</IfModule>

This alone can reduce HTML, CSS, and JavaScript transfer sizes by 60–80%.

Optimizing Images Before Upload

Gzip does not help binary image files. You need to optimize images at the file level:

  • JPEG: Use mozjpeg or tools like Squoosh (free, browser-based) to reduce file size by 30–60% with no visible quality loss.
  • PNG: Run through pngquant for lossy compression or OptiPNG for lossless.
  • WebP conversion: Modern browsers support WebP, which is typically 25–35% smaller than equivalent JPEG. In WordPress, plugins like Imagify, ShortPixel, or WebP Express handle conversion automatically on upload.

Setting Proper Cache Headers for Images

Add browser caching rules to .htaccess so returning visitors don't re-download the same images:

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png  "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>

5. Enable GZIP and Leverage Browser Caching via cPanel's Built-in Tools

Some cPanel installations ship with the Optimize Website tool under the Software section. It lets you enable Gzip compression globally with a single click — no manual .htaccess editing required. Check whether your host has enabled it:

  1. In cPanel, search for Optimize Website.
  2. Select Compress All Content (or choose specific MIME types).
  3. Click Update Settings.

If the tool is available, use it as a starting point, then fine-tune with .htaccess for more granular control.

6. Review and Reduce .htaccess Complexity

Every HTTP request on an Apache server processes .htaccess from the document root down. Bloated or redundant rules add measurable overhead, especially on high-traffic pages.

Common culprits:

  • Duplicate redirect rules left behind by multiple plugins
  • Overly broad rewrite conditions that never match
  • Security plugins adding hundreds of rules inline

Audit your .htaccess periodically. Move rules into a child .htaccess in the specific subdirectory where they apply rather than stacking everything in the root.

7. Monitor Performance After Each Change

Don't change everything at once — you'll have no idea what actually helped. Use a systematic approach:

  1. Baseline your current score with Google PageSpeed Insights or GTmetrix before making any changes.
  2. Apply one optimization at a time.
  3. Re-test and record the delta.
  4. Only proceed to the next optimization after confirming the previous one took effect.

Key metrics to watch:

  • Time to First Byte (TTFB): PHP and MySQL optimizations show here.
  • Largest Contentful Paint (LCP): Image and caching improvements show here.
  • Total page weight: Compression and image optimization show here.

Putting It All Together

Speed optimization on cPanel hosting is a layered process. There is no single magic switch. The highest-ROI actions in order are:

  1. Upgrade PHP to 8.x — free, immediate, and significant.
  2. Enable OPcache — eliminates redundant compilation work.
  3. Add a page cache layer — bypasses PHP and MySQL entirely for static content.
  4. Optimize and compress images — reduces the heaviest assets.
  5. Set browser cache headers — eliminates repeat downloads.
  6. Tune .htaccess — reduces per-request overhead.

If you are looking for a cPanel hosting provider that gives you access to these controls out of the box — including MultiPHP Manager, OPcache configuration, and phpMyAdmin — GoCelerus's shared hosting plans are worth exploring as a starting point.

Implement these changes systematically, measure your results, and your site will noticeably respond faster — often cutting TTFB in half without touching a single line of application code.

Welcome to GoCelerus

Save 15% on any plan

Launch promo — 15% off any plan

Your coupon code

LAUNCH15
Browse plans