By Default WordPress will consume lot resource if its Not optimized in proper Way.Do the following to your WordPress sites
- · Remove any Pirated Plugins or Themes (Pirated files will have malicious Code injected)
- · Keep your Files up to date.WP Core,Themes and Plugins
- · Add Cloudflare to your website to protect from any attacks (cloudflare.com)
- · Add robots.txt to control unwanted Bot access
- · Remove any unused themes.Remove Unused Theme or plugin which are not activated or no need for your use
With this done and still your website is still not fast enough they are a few tweaks we can work with to make it blazing fast.
1. Compressing files Gzip
cPanel includes the Optimize Website function. It uses Apache’s mod_deflate to compress content before sending it to the visitor’s browser.
Gzip is the most popular and effective compression method today. If gzip compression is enabled for website content, it generally reduces the response size by about 70%. To gzip your website components, log in to your cPanel >> go to the Software section >> the Optimize Website menu.
For cPanel Basic Theme:
Here you need to select Compress All Content and click on Update Settings
2. Adjusting Cron Jobs
Every time a visitor goes to your site or loads a page, wp-cron.php is triggered. This is WordPress checking to see if it needs to do anything. This includes checking for updates, scheduled posts, email notifications, or a number of other tasks. When your website is getting several thousand or more hits per day, this uses up resources unnecessarily. Disabling the default wp-cron.php will be a lifesaver.
Open wp-config.php and add the below code. Usually place new code near the debug function.
Now, login to cPanel and setup a Cron Job to hit wp-cron.php every hour. Change the username to your cPanel username and make sure the path is correct, especially if you’re on a subdomain or subdirectory.
cd /home/CPANELUSERNAME/public_html; php -q wp-cron.php
3. Database Bloat & Revision Control
Every time you save a post, WordPress saves a version of that post in the database. These are all accessed via the Revisions interface. WordPress will keep saving every version indefinitely. I got up to 48 revisions on this post alone in writing the initial spec. Figuring out an appropriate number of revisions for your style and setting that will reduce the size of the database. Set it to 7 via wp-config.php:
Whew! You made it to the end. Please comment if:
- · This helped you in any way – post screenshots of your results from Pingdom or Gtmetrix!
- · I missed something
- · You have a better config to share