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

How to Speed Up Your cPanel Hosting Website Fast

By Yoga · 04 Aug 2026 · 3 min read

How to Speed Up Your cPanel Hosting Website Fast

If your website feels sluggish, the problem is rarely just your hosting plan. Most cPanel-hosted sites are leaving significant performance on the table because of misconfigured PHP settings, unoptimized databases, and bloated images. This guide walks you through concrete, actionable steps you can take inside cPanel today — no server admin experience required.

Why Website Speed Matters More Than Ever

Google uses Core Web Vitals as a ranking signal, and visitors abandon pages that take more than 3 seconds to load. Slow sites lose both search visibility and revenue. The good news: cPanel gives you direct access to several performance levers that most site owners never touch.

Before you start, benchmark your current performance using PageSpeed Insights or GTmetrix. Note your Time to First Byte (TTFB) and Largest Contentful Paint (LCP) scores — these are the numbers you want to move.


1. Upgrade to the Latest PHP Version

This is the single highest-impact change you can make. PHP 8.x is significantly faster than PHP 7.4 or earlier, thanks to a rewritten JIT (Just-In-Time) compiler and improved memory management.

How to Change Your PHP Version in cPanel

  1. Log in to cPanel and navigate to Software → Select PHP Version.
  2. From the dropdown, choose the highest PHP 8.x version your application supports (check your CMS or plugin compatibility first).
  3. Click Set as Current.
  4. Test your site thoroughly after switching — some legacy plugins break on newer PHP versions.

Quick check: WordPress 6.x officially supports PHP 8.2. If you're running PHP 7.4 on a WordPress site, you're leaving roughly 20–30% raw execution speed on the table.

PHP-FPM vs. Standard PHP Handler

If your host exposes the option, switch from DSO (Apache mod_php) to PHP-FPM. PHP-FPM spawns separate worker processes per domain, reducing memory overhead and improving concurrency under traffic spikes.

In cPanel's MultiPHP Manager, look for the PHP Handler column next to your domain. Change it from dso or cgi to fpm if available.


2. Enable OPcache for PHP Bytecode Caching

Every time PHP runs a script, it parses and compiles it from raw source code. OPcache stores the compiled bytecode in memory, so PHP skips that compilation step on subsequent requests. The result: dramatically faster PHP execution with zero code changes.

Enabling OPcache in cPanel

  1. Go to Software → Select PHP Version.
  2. Click Switch to PHP Options (usually a link near the top of the page).
  3. Find opcache.enable and set it to On.
  4. Recommended settings to also configure:
Setting Recommended Value Purpose
opcache.enable 1 Enables OPcache
opcache.memory_consumption 128 MB of RAM reserved for cache
opcache.max_accelerated_files 10000 Max cached scripts
opcache.revalidate_freq 60 Seconds before checking for file changes
opcache.validate_timestamps 1 Set to 0 on production for max speed

Production tip: On a live site where you deploy code infrequently, set opcache.validate_timestamps to 0 and manually reset the cache after each deployment. This eliminates file-stat calls on every request.

You can verify OPcache is active by creating a temporary PHP info file:

<?php
// Save as opcache-check.php, visit it once, then DELETE it
phpinfo();

Search for "opcache" in the output. If you see a green "enabled" status, it's working.


3. Optimize MySQL with Query Caching and Indexing

A slow database is one of the most common causes of high TTFB. cPanel gives you access to phpMyAdmin and, on some hosts, MySQL Tuner output in WHM. Here's what to focus on.

Identify Slow Queries First

Before optimizing blindly, enable the slow query log temporarily. If you have SSH access:

# Connect via SSH, then run:
mysql -u root -p
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1; -- Log queries taking more than 1 second
SET GLOBAL slow_query_log_file = '/tmp/mysql-slow.log';

Browse your site for a few minutes, then review /tmp/mysql-slow.log for repeat offenders.

Add Indexes to Frequently Queried Columns

If a specific query keeps appearing in the slow log, the table likely lacks an index on its WHERE clause column. In phpMyAdmin:

  1. Open the database → select the table → click Structure.
  2. Find the column used in the slow WHERE clause.
  3. Click the Index icon to add a regular index.

For example, if your CMS queries wp_posts by post_status and post_date frequently, a composite index on those two columns can cut query time by 10x.

Use InnoDB, Not MyISAM

Check your table engine in phpMyAdmin under the Structure tab. InnoDB supports row-level locking (vs. table-level in MyISAM), which is critical for sites with concurrent read/write operations.

To convert a table:

ALTER TABLE wp_options ENGINE = InnoDB;

4. Enable Gzip Compression in cPanel

Gzip reduces the size of HTML, CSS, and JavaScript files before they're sent to the browser — typically by 60–80%. Many cPanel setups don't enable this by default.

Option A: Via cPanel's Optimize Website Tool

  1. In cPanel, search for Optimize Website under the Software section.
  2. Select Compress All Content or Compress the specified MIME types and add text/html text/css application/javascript.
  3. Click Update Settings.

Option B: Via .htaccess (Apache)

If the GUI option isn't available, add this to your site's .htaccess file:

<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>

Verify compression is working by checking the response headers in your browser's DevTools Network tab — look for Content-Encoding: gzip.


5. Compress and Lazy-Load Images

Images are usually the largest assets on a page. Uncompressed images are the number-one cause of poor LCP scores.

Compress Images Before Uploading

  • For JPEG/PNG: Use Squoosh (free, browser-based) to compress without visible quality loss. Aim for JPEG quality 75–85.
  • Convert to WebP: WebP files are 25–35% smaller than JPEG at equivalent quality. Squoosh and cPanel's Imager (if available) can handle conversion.

Serve Responsive Images with srcset

Don't serve a 2000px-wide image to mobile users. Use HTML srcset to let the browser pick the right size:

<img
  src="hero-800.webp"
  srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
  sizes="(max-width: 600px) 400px, (max-width: 900px) 800px, 1200px"
  alt="Hero image"
  loading="lazy"
/>

The loading="lazy" attribute defers off-screen image loading natively — no JavaScript needed.

For WordPress Users

Install a plugin like Imagify or ShortPixel that integrates directly with your Media Library to bulk-compress existing images and auto-compress new uploads. Both support WebP conversion.


6. Leverage Browser Caching via .htaccess

Browser caching tells returning visitors to store static assets locally instead of re-downloading them. Add the following to your .htaccess:

<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"
  ExpiresByType text/html "access plus 1 hour"
</IfModule>

This alone can eliminate hundreds of HTTP requests for repeat visitors.


Putting It All Together

Here's a quick priority checklist:

  • Upgrade PHP to 8.x and switch handler to PHP-FPM
  • Enable and configure OPcache
  • Identify slow MySQL queries, add missing indexes, use InnoDB
  • Enable Gzip compression via Optimize Website or .htaccess
  • Compress images, convert to WebP, use srcset and lazy loading
  • Set browser cache headers for static assets

Work through these in order — PHP version and OPcache give you the fastest wins with the least risk. Database and image work takes more time but delivers the biggest improvements to perceived load speed.

If you're looking for cPanel shared hosting that gives you full access to PHP version management, OPcache configuration, and phpMyAdmin without locking you out of these settings, GoCelerus offers hosting plans built for developers who want control over their stack.


Run another PageSpeed Insights audit after each change so you can attribute improvements to specific optimizations. Performance tuning is iterative — small gains compound over time into a significantly faster user experience.

Welcome to GoCelerus

Save 15% on any plan

Launch promo — 15% off any plan

Your coupon code

LAUNCH15
Browse plans