Skip to content
Web Hosting

How to Speed Up WordPress on Shared Hosting Without a Plugin

In this article13 sections

You can speed up WordPress on shared hosting without a plugin by using tools you already have: update PHP in cPanel, add browser caching and compression rules to your .htaccess file, limit post revisions in wp-config.php, remove the emoji script, clean out old data from the dashboard, and shrink images before you upload them. Each step is a small edit with a clear undo, and together they make pages lighter and repeat visits faster.

These steps are written for cPanel hosting on LiteSpeed servers, which is what SiteHarbour shared hosting uses. If you would rather install a plugin and be done in a few clicks, the guide on speeding up WordPress in 5 easy steps covers that route. If you are not sure why your site is slow in the first place, start with Why Is My WordPress Site Slow?

Step 1: Make a backup first

You will edit two important files, so make a backup before you touch anything. In cPanel, open Backup Wizard, choose Back Up, then Full Backup, and download it to your computer. For the file edits below, you will also copy each file before changing it.

Warning. A typing mistake in .htaccess, wp-config.php or functions.php can show a blank page or a 500 error. That is not permanent. Restore the copy you made and the site comes back. Never edit these files without a copy.

Step 2: Update your PHP version

PHP builds every page, and newer versions run the same WordPress code faster. In cPanel, open MultiPHP Manager under Software, tick your domain, choose the newest version your theme and plugins support, and click Apply. Then open your site and your /wp-admin login. If either shows an error, return to MultiPHP Manager, choose the previous version and update the outdated plugin or theme that caused it.

Step 3: Add browser caching and compression

Browser caching tells a visitor’s browser to keep images, styles and scripts for a while, so repeat visits do not download them again. Compression shrinks text files before they are sent. Both are set in .htaccess, and LiteSpeed reads this file.

  1. In cPanel, open File Manager, go to public_html (or your site’s folder), and turn on Settings, Show Hidden Files, because .htaccess is hidden by default.
  2. Right-click .htaccess, choose Copy, and name the copy .htaccess-backup.
  3. Right-click the original and choose Edit.
  4. Scroll to the very end and paste the rules below, after the # END WordPress line. Do not put them inside the WordPress block, because WordPress rewrites that block.
  5. Click Save Changes and open your site to check it still loads.
# BEGIN SiteHarbour caching
<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 image/svg+xml "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>
# END SiteHarbour caching

Tip. If the site shows a 500 error after saving, open .htaccess again and delete the lines you added, or delete the file and rename .htaccess-backup back to .htaccess.

Your server may already compress files. If so, the extra compression rule does no harm. The caching rules still help, because they cover images, fonts and scripts.

Step 4: Limit post revisions and empty the trash

WordPress saves a copy of a post every time you update it, and keeps those copies forever. On a busy site they pile up in the database. Two lines in wp-config.php keep only the latest five and empty the trash after seven days.

  1. In File Manager, copy wp-config.php to wp-config-backup.php, then edit the original.
  2. Find the comment that says That’s all, stop editing.
  3. Paste these two lines above it, then save:
define( 'WP_POST_REVISIONS', 5 );
define( 'EMPTY_TRASH_DAYS', 7 );

This only affects new revisions. Old ones stay in the database until they are removed, which is optional and not needed for most sites.

Step 5: Remove the emoji script

WordPress loads a small script on every page to show emoji on old browsers. Modern browsers do not need it, so removing it saves a request on every page.

  1. In WordPress, go to Appearance, then Theme File Editor, and open functions.php. If you do not see this menu, use File Manager and open wp-content/themes/your-theme/functions.php.
  2. Copy the file first, as in the earlier steps.
  3. Paste this at the very end of the file and save:
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emojis_styles' );

Warning. Use a child theme if you can. A theme update replaces functions.php and removes your lines. Also make sure there is no closing ?> tag above where you paste, and that you copied both lines exactly.

Step 6: Clean out old data from the dashboard

You do not need a plugin to remove clutter that slows the database down:

  • Spam comments: go to Comments, then Spam, and click Empty Spam.
  • Trashed comments and posts: open each Trash view and empty it.
  • Old drafts and unused pages: delete the ones you will never publish.
  • Unused media: in Media, delete files you no longer use. Check before you delete, because a file may still be used on a page.

Step 7: Shrink images before you upload

Large images are the most common reason a page is heavy. Resize and compress every image before you upload it, using a free browser tool such as Squoosh (squoosh.app). A width of about 1600 pixels is enough for a full-width image, and most blog images need only 100 to 200 KB. WordPress already adds lazy loading to images by default, so images below the visible area load later without any setting from you.

Step 8: Remove plugins and themes you do not use

Go to Plugins, then Installed Plugins, and deactivate and delete anything you no longer use. Do the same for unused themes under Appearance, keeping your active theme and one default WordPress theme as a fallback. Fewer active plugins means less code on every page.

What you give up without a plugin

Be realistic about the limit of this approach. A page cache, which saves finished pages and serves them without rebuilding them, is the single biggest gain for most sites, and it normally needs a plugin on shared hosting. Everything in this guide makes pages lighter and repeat visits faster, but it does not remove the work of building each page. If your site is still slow after these steps, adding LiteSpeed Cache as in the 5-step guide is the logical next move.

When you need more headroom

These steps make a site lighter, but they cannot add server capacity. If your pages are still slow at busy times after you have done all of the above, the site may have outgrown its plan. You can compare plans on our shared hosting page, and our support team can help you decide whether tuning or an upgrade is the better next step.

How to check that it worked

Test the same page before and after at PageSpeed Insights. Look at the cache and image findings in particular, because those are what this guide changes. Open your site in a private window as well, so you see what a visitor sees and not the logged-in version.

Common mistakes to avoid

  • Editing without a copy. Always copy the file first. It is your fastest undo.
  • Pasting rules inside the WordPress block. WordPress rewrites everything between # BEGIN WordPress and # END WordPress, so your lines would disappear. Put them below it.
  • Using a word processor to edit. Curly quotes break code. Edit only in File Manager or the Theme File Editor.
  • Changing everything at once. Make one change, check the site, then continue.
  • Expecting a page cache. These steps lighten your pages. They do not replace a caching plugin.

Related guides: fixing WordPress emails going to spam.

Frequently asked questions

Is it safe to edit .htaccess?

Yes, if you copy it first. A mistake usually causes a 500 error, which you fix by restoring the copy.

Will these changes survive a WordPress update?

Changes to .htaccess and wp-config.php stay. A change to your theme’s functions.php is lost when the theme updates, unless you use a child theme.

Why is there no cache step?

Full page caching on shared hosting normally needs a plugin, and a manual setup is risky for beginners. The plugin route is covered in a separate guide.

How much faster will my site be?

It depends on what was slowing it down. Heavy images and old PHP versions usually matter most. Test before and after on the same page.

Can I undo everything?

Yes. Each step either has a file copy to restore or can be reversed by deleting the lines you added.

The short version: back up, update PHP, add caching rules below the WordPress block in .htaccess, limit revisions in wp-config.php, remove the emoji script, clean the dashboard, shrink images and delete unused plugins.

Share this guide