Performance & Optimization Wordpress Tips
10 Steps to Speed Up Your WordPress Website Hosted on cPanel

A slow WordPress site doesn’t just frustrate your users — it hurts your SEO, conversion rates, and credibility. If you’re hosted on a cPanel-based server (like most shared hosting platforms), you still have a lot of control. This guide provides 10 actionable, fault-tolerant steps to boost your site’s speed and performance.

Each step includes precautions, scripts, and recovery tips, so you can proceed with confidence.


✨ Prerequisites

Before we begin, ensure you have:

  • Access to cPanel
  • Access to phpMyAdmin or MySQL Databases
  • Access to File Manager or FTP
  • A working knowledge of WordPress (admin area, plugins)

Recommended:

  • Create a full backup using cPanel > Backup Wizard or manually (explained below).

✅ Step 1: Take a Full Website Backup

Always start with a safety net. Use the cPanel Backup Wizard:

Manual Backup via File Manager & phpMyAdmin:

  1. Compress /public_html into a .zip and download it.
  2. Export your database from phpMyAdmin.
-- phpMyAdmin export command
-- Select your WordPress DB > Export > Quick > SQL

Automated Backup Script (Cron-compatible)

#!/bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="$HOME/backups"
mkdir -p $BACKUP_DIR

# Backup Files
tar -czf $BACKUP_DIR/wpfiles-$TIMESTAMP.tar.gz ~/public_html

# Backup Database
mysqldump -u YOUR_DB_USER -p'YOUR_DB_PASSWORD' YOUR_DB_NAME > $BACKUP_DIR/wpdb-$TIMESTAMP.sql

🔌 Step 2: Enable GZIP Compression

Compress HTML, CSS, and JS using .htaccess. Add the following at the top:

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

Recovery Tip: Always create .htaccess.bak before editing.


🖼 Step 3: Optimize Images Automatically

Install a plugin like ShortPixel or Smush for bulk optimization.

For non-WordPress users or shell access:

find ~/public_html/wp-content/uploads -type f -iname '*.jpg' -exec jpegoptim --strip-all {} \;
find ~/public_html/wp-content/uploads -type f -iname '*.png' -exec optipng -o7 {} \;

🌐 Step 4: Leverage Browser Caching

Update .htaccess:

# BEGIN Caching
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "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 week"
</IfModule>
# END Caching

Verify with: https://gtmetrix.com/


🔹 Step 5: Minify CSS, JS, and HTML

Use plugins like Autoptimize or WP Rocket.

Manual Minify (CLI users):

# Minify CSS
find . -name "*.css" -exec yui-compressor {} -o {} \;

# Minify JS
find . -name "*.js" -exec yui-compressor {} -o {} \;

🌍 Step 6: Use a CDN

Sign up with Cloudflare (Free plan):

  • Update nameservers from your domain panel
  • Enable caching, Brotli, and auto-minify

Recovery: Keep original nameservers noted for rollback.


📊 Step 7: Optimize Database

Via phpMyAdmin:

  • Select all tables > With Selected: Optimize Table

SQL Script:

OPTIMIZE TABLE wp_posts, wp_comments, wp_options, wp_postmeta;

Plugin Alternative: Use WP-Optimize for GUI control


❌ Step 8: Disable Unused Plugins and Themes

  • From WP Admin, deactivate & delete unused plugins/themes
  • Less code = faster loading

Backup Plugin List (CLI):

wp plugin list > plugin-list.txt

🔧 Step 9: Use LiteSpeed or Caching Plugins

  • If host supports LiteSpeed: enable it in cPanel
  • Else: use WP Rocket, W3 Total Cache, or LiteSpeed Cache plugin

Important: Clear cache after major site changes


⌛ Step 10: Monitor Load Time & Set Alerts

  • Use UptimeRobot or GTmetrix Monitoring
  • Optionally script rollback if downtime > X minutes (advanced users)

🚫 Recovery & Rollback Summary

  • .htaccess.bak – Restore default rules
  • wpdb-*.sql – Restore from phpMyAdmin
  • wp-content.zip – Upload via File Manager
  • Disable plugin via DB (if plugin breaks site):
UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';

🔄 Final Thoughts

Speed optimization isn’t a one-time job. Regular maintenance, updates, and a solid monitoring plan are crucial. By following these 10 cPanel-based WordPress tuning steps with safety-first execution, you’ll be well ahead of 90% of WordPress site owners.

Happy optimizing!

This article is part of the RWH Insights series by RightWebHost.com – offering expert reviews, practical tips, and performance strategies for developers, site owners, and hosting professionals. Stay tuned for more actionable guidance on how to choose the right hosting and get the most out of your tech stack.

Author

RWH Advisory

Mary is a technology enthusiast and the voice behind many of the insightful articles at RWH Insights. As part of the RWH Advisory team, she combines deep knowledge of hosting solutions, WordPress performance, and AI infrastructure with a clear, engaging writing style.Mary believes that great hosting choices power great ideas — and she’s here to help you find the perfect fit, whether you’re launching a simple blog or building the next AI-powered SaaS platform.