20 Feb

How to Optimize WordPress for Better Performance in Cpanel Hosting

Optimizing WordPress for Better Performance in Cpanel Hosting is very important as WordPress is simply put rather heavy in terms of PHP built sites. enhancement SEO and speed of wordpress site to the two main key factors :

  • Web hosting optimization:
  • Web site optimization

Whether you run a high traffic WordPress installation or a small blog on a low cost shared host, you should optimize WordPress and your server to run as efficiently as possible When sites are getting over 100,000 visitors per month, every millisecond counts. Whether you are running a blog, enterprise site, or local business, ensuring your visitors and customers have a fast speed can make all the difference between someone who clicks away and someone who stays for a while.

Optimizing for WordPress Shared Hosting :

The first step in WordPress optimization is choosing a good web host to compare to the budget as well as Pakistan Web Server Shared Hosting Plans

  • Cpanel Hosting Optimization :
    Enable the Compress All Content :   Go to cpanel > Optimize Website > then enable Compress All Content option
  •  Hotlink protection :  Cpanel > Hotlink > Enable
  • Its a good idea to make sure your DKIM and SPF records under Authentication are valid Active
  • Use of CloudFlare , Litespeed , or Varnish Casha in server side

if you have access to WHM root for VPS Hosting or server hosting you can configure the following setting as well

Tweak Settings

  • Updating Use pigz from Off to On. Updating Bandwidth limit check from On to Off Updating Allow
  • cPanel & WHM to determine the best value for your MySQL max_allowed_packet configuration? from
  • On to Off Updating Allow cPanel & WHM to determine the best value for your MySQL open_files_limit
  • configuration? from On to Off. Updating Critical load threshold from “10” to # of CPUs (autodetect).
  • Apache non-SSL IP/port


Optimized Apache
A hand tip to improve overall performance on your site without updating hardware is to optimize Apache correctly. There are many things you can alter to improve your performance, however, WHM is quite limiting when wanting to do so. You can alter the following settings at the in the Apache Global configurations. Located at:

Home >> Service Configuration >> Apache Configuration >> Global Configuration

When set to “on”, Keep-Alive enables a persistent connection between your server and the user, providing long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases, this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images. To enable Keep-Alive connections in Apache 1.2 and later, set KeepAlive On.

This directive is used to define the number of requests allowed per connection when KeepAlive is enabled. When the value of this option is set to “0”, unlimited requests will be allowed on the server. For server performance, it’s recommended to allow unlimited requests.

This directive is used to define how much time, in seconds, Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the “Timeout” directive applies. The value of “10” seconds is a good average for server performance. This value should be kept low as the socket will be idle for extended periods otherwise.

This directive is used to define the limit on the number of child processes that will be created to serve requests. The default means that up to 512 HTTP requests can be handled concurrently. This is an important tuning parameter regarding the performance of the Apache web server. For a high load operation, a value of “512” is recommended. For standard use, you can set the value to “256”.

This directive is used to define the minimum number of idle child server processes that should be created. An idle process is one which is not handling a request. If there are fewer than “MinSpareServers” idle, then the parent process creates new children at a maximum rate of 1 per second. The idle value is 10 MaxSpareServer: This directive is used to define the maximum number of idle child server processes that should be created. If there are more than “MaxSpareServers” idle child processes, then the parent process will kill off the excess processes and these extra processes will be terminated.The idle value is 15.

This option is used to define the number of requests that an individual child server process will handle. Set this directive to “0” to get the maximum performance and scalability for the server.

When set to “Off”, this directive will disable DNS lookups. It’s recommended to set this option to “Off” in order to avoid latency with every request. This will also save the network traffic time and improve the performance of your Apache web server.

For security, it is also a good idea to disable directory listings. You can do this by scrolling to the Directory options on the Global configuration page. There you will be able to disable indexing.

Optimize MySQL
When using a dynamic environment, it can be very beneficial to correctly configure your SQL settings. Replace your existing my.cnf file to the following.

max_allowed_packet = 1M
max_connections = 300
max_user_connections = 35
quick max_allowed_packet = 16M

To reduce RAM usage, you should also convert your InnoDB tables to MyISAM. RAM is a very important factor to worry about when running in a virtual environment. InnoDB uses a high amount of RAM and is recommended you avert using it. This might impact load times slightly, but it also allows the converted database tables to be accessed with a much lower memory footprint. You can change these formats with any SQL UI such as PHPMyAdmin.

Performance Schema
For MySQL 5.6.6+, disable performance_schema. This is turned on by default and tends to use a lot of RAM!
To disable performance_schema:

  1. Open my.cnf (typically @ /etc/my.cnf) via SSH or VPS admin panel >> add the following line just under [mysqld] >> performance_schema=0
  2. Save/close my.cnf and restart mysql service.

To decrease the size of data that’s being transferred between your server and your visitors, you can enable the gZIP compression for your images, CSS and JavaScript files

Optimize  WordPress Configuration

  • Optimize your Images

Images are essential part of every website. It is important to have them optimized. There are few things regarding your images that you should have in mind when developing your WordPress site

  • Minimizing Plugins

The first and easiest way to improve WordPress performance is plugins. Deactivate and delete any unnecessary plugins. Try selectively disabling plugins to measure server performance. Is one of your plugins significantly affecting your site’s performance?

Then you can look at optimizing plugins. Are plugins coded inefficiently? Do they repeat unnecessary database queries? WordPress has its own caching system, so generally speaking, using functions like get_option(), update_option() and so on will be faster than writing SQL.


  • Theme optimization.
  • Caching and Browser Caching Plugin 

Caching plugins allow you to publish static HTML files instead of dynamic files. This greatly reduces the time a page takes to load as there are no PHP or MySQL commands to execute.

Additional caching features include minification, caching of feeds, Gzipping, Content Delivery Network (CDN) support, and much more.

Caching your pages is one of the most effective ways of improving your page loading times, with many plugins promising an improvement of at least ten times. Popular caching plugins include WP Super CacheW3 Total Cache and WP Fastest Cache. All three plugins are available free.

Don’t have the time to optimize WordPress? Don’t really know what you’re doing?

Share this

Leave a Reply

Be the First to Comment!

Notify of