Optimize WordPress Performance

With our service, there are many ways to dramatically speed up the performance of your WordPress website.

With Ultra Web Hosting we allow for a hefty amount of server RAM usage on our shared hosting plan for the Ultra Unlimited at 384MBs which is more than most hosting providers. Our solid-state drives, Nginx and Redis stacks also greatly increase performance. Unfortunately, some scripts such as WordPress can go over this allotment and can require more resources. For larger demanding scripts/websites like WordPress, Joomla and Magento we have available the Ultra Unlimited Pro plan, VPS and dedicated server plans. Fortunately, there is a lot you can do for WordPress to optimize it so an upgrade may not be needed. To optimize WordPress performance, the following tips are a great way to squeeze the most out of your WordPress installation.


Caching
Be sure you have caching enabled. Caching prevents the unnecessary processing of duplicate information every time a page is loaded. Once it is processed and loaded, that processed information is re-used when caching is enabled. There are several great caching plugins available. We highly recommend WP Super Cache with the recommended options enabled in advance and preload mode enabled. In some environments "Use PHP to serve cache files" may run faster. Be sure to test the speeds between them via the benchmark websites listed below. If that particular plugin gives you any troubles WP Fastest Cache is also excellent. If you want to try a different plugin that allows for finer tweaking and does not mind getting your hands dirty we recommend W3 Total Cache. It is an excellent plugin and may be configured for xcache / opcache but we highly recommend Disk Enhanced mode in most cases. When used in conjunction with UltraSpeed with our Unlimited Pro, VPS, and dedicated plans, it can result in in some pretty astonishing speeds. It may be installed right in your WordPress admin plugins area. It is worth testing between these with online website speed test benchmarks such as what is offered by Pingdom and GTMetrix. Now these two websites can be a bit interesting as they can go over the top in grading a site and often in your quest to acquire that A grade you can end up degrading the performance of the site. Focus on load times, as that will be the best user experience overall, not the grade. 

Do note, when using caching and developing, be sure to delete your cache and turn it off, otherwise, you may encounter issues you may not have expected. Once complete, re-enable it.



Disable JetPack
We have seen a lot of performance issues and downtime with JetPack and recommend disabling it. 



Tidy
Tidy is available as well for use with our service which can shrink down your css, javascript and pages. Fast-velocity is a great plugin to use and tackle this. If you notice any css or js issues after enabling it, you can tweak or disable those via its interface. Be sure to clear your cache after making the changes. Now be careful with this plugin, it does need a bit of tweaking and doesn't always handle the job well. If you are having problems with the website after enabling this plugin and clearing your cache and have played with the configuration a bit, feel free to disable and remove it, there are other areas you can still improve things.



UltraSpeed
We highly recommend you perform all the optimizations on this page first, once complete, come back to this area. This mode is being mentioned early so it is not overlooked. When you are ready, log into your hosting control panel and go to the UltraSpeed section, select Configure for the domain, using the drop down and select PHP and click select, for the Upstream use a newer version of PHP, and for configuration select "WordPress-FullPage-Cache" near the bottom and click Apply Upstream Configuration. This will take a couple of minutes and you will be switched over to the UltraSpeed optimized stack! 



Add a CDN
Content delivery network services speed up your WordPress site by delivering static content to your visitor by a server closer to where they are. As a CloudFlare Certified hosting provider we offer faster, easier integrations, and easy access to their free plan. Click CloudFlare in the software section of your account's hosting control panel and follow the easy steps. 



Optimize your Databases
Databases grow over time! Even if you have less traffic than usual, the load of your account may be higher as a result of a larger database. Do you really need to bloat your database with 2000 revisions of your posts? WPOptimize and Better Delete Revision Manager are both great plugins for going in and wiping out all those unnecessary saved revisions eating up database space. They will also perform an optimization afterward. The smaller the database, the less memory used. With WP-Cleanup you have the benefit of clearing out comment spam quickly as well.  Be sure to prune/cleanup/remove unnecessary table information such as logs over time and optimize your database! Reducing the size of your database can considerably increase the performance of your website. Closing comments on pages where they are not needed is also another great way to improve performance. Load up phpMyAdmin from your hosting control panel with us, select the database and use the optimize function. Plugins such as WPOptimize and Better Delete Revision both clean and optimize the database. When using WPOptimize, it is best to stick to the default options.



Block Bad Bots
Another tip is to use our bad bot blocker to stop bad bots from spamming and downloading your website.

In the case of spambots hogging up your resources, placing the following in your .htaccess file can mitigate this:

# Stop spam attack logins and comments
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login)\.php*
RewriteCond %{HTTP_REFERER} !.*(example.com|jetpack.wordpress.com).* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]
</ifModule>



Disable Pingbacks and Trackbacks
What was once a useful feature is now flooded with automated bots and spammers. We recommend disabling pingbacks and trackbacks. For web pages that were created with them enabled, you can disable them afterward by entering the following commands into your phpMyAdmin area, selecting the proper database, select the SQL table and run the following:

UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post'; 
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';



Leverage Browser Caching
Sometimes we have to force the web browser to utilize caching on certain filetypes via expired headers which can speed up your website by having the visitor's browser re-use their existing cache files. Both mod_expires and mod_deflate must be installed. The following may or may not work, be sure to backup your configuration first. To perform this, add the following to your .htaccess file before the common WordPress configuration lines:


# Expires Caching Start #

ExpiresActive On
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresDefault "access 1 month"

# TN Expires Caching End #



Enable "Vary: Accept-Encoding" header. Add the following to your .htaccess file:


<IfModule mod_headers.c>
  <FilesMatch ".(js|css|xml|gz|html|ttf|eot|font.css|ttc|woff|otf|svg)$">
    Header append Vary: Accept-Encoding
    Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
 



Reduce Plugins
Too often we find WordPress installs which are loaded down by the use of too many unnecessary plugins. The more plugins you have installed the more processor load is required and the slower the performance of your site becomes. Try to limit your active plugins as much as possible, if it is not being actively used, disable it. 



Optimize Your Images
As mentioned, often we find developers sticking huge non-internet friendly images up for sliders and backgrounds, optimize those! Even 25% in file size savings can be tremendous on a site. For large images, we recommend TinyPNG.org as it really can squeeze out some file size savings. For WordPress plugins check out TinyPNGSmush.it or EWWW Image Optimizer. Smush.it is more server friendly and will install on most hosting plans but is not always as clean as EWWW with retaining image quality. We do recommend using Smush.it with our Ultra 1x and Ultra Unlimited hosting plans. Use the bulk modes to shrink down your existing images in minutes. You can find the bulk mode for Smush.it under the Media area in WordPress. For manual optimization, kraken.io works great without losing quality. To shrink files Tinypng is great but will result in some quality loss.



Use .jpg Over .png for Large Photo Images
jpg compresses far better than png when it comes to photos. Smaller image files mean faster downloads.



Some very high-load plugins include WordPress SEO by Yoast, Akismet, Contact Form 7, MyReviewPlugin, LinkMan, Fuzzy SEO Booster, WP PostViews, Tweet Blender, Dynamic Related Posts, Jetpack by WordPress, Really Simple CAPTCHA, Pretty Link Lite, Useful Banner Manager. Often one plugin can slow down your entire site from loading. Check out UsageDD to help locate that trouble plugin.


Combine and minify. Velocity, as mentioned previously, can perform this. For the more advanced, you can minify (reduce spaces and useless lines) in your files manually through an online minifier such as https://www.toptal.com/developers/cssminifier


With all of your install up to date, update your PHP to PHP7. You can see significant increases in speed moving to PHP7 (up to 200%) as it is far more efficient and deals with multi-threading better. You can switch versions right from your hosting control panel and the "Select PHP Version" icon.



Check Your External Content Load Times
Often when you link to an external source such as an image or video, the time it takes for that object to load can affect how your page loads. When using Pingdom you can sort by load times and see if there are any external objects slowing you down.




Disable Hotlinking and Leeching
If you have some popular images indexed by the search engines you may find your images being used by others. This can be a blessing and also a negative. It is great for SEO but the wrong site linking your website can really burden it. Use the hotlink protection icon in your hosting control panel to protect your site if it is a negative. 

Note: If you have other websites on your hosting account this may not function properly.


Remove Version Strings
Often version strings such as css/ie.css?ver=20161207 can prevent files from properly caching with your server or CDN. To remove these strings, add the following code to the end of your theme's function.php before the php close tag:

// Remove Query String
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );


The "Remove query strings from static resources" plugin can also be useful for this.



Reduce How Many Posts Display on a Single Page
4-5 is a great number of posts or try a theme that has excerpts of each page and links to them.



http keep-alive

When it comes to PHP scripts having a server with keep-alive enabled is generally recommended as this prevents a connection from being re-established on every web page visited. If you have full page caching or static versions, this is not necessary though so not enabling it is the recommended path. If you are working with static files and UltraSpeed, again, this is not needed.

 


Don't forget to enable UltraSpeed now! Scroll back up to the UltraSpeed section for details here.

 


If after all these recommendations you still require more performance, we have WordPress Optimized, VPS and dedicated server plans available which we can optimize for your particular install of WordPress.



If you would like us to perform these changes for you, we have consultation available here.


  • 204 Users Found This Useful

Was this answer helpful?

Related Articles

Plugins on WordPress

There are many great ways to setup and install plugins on WordPress. You may find a library of...

JetPack server was unable to connect with your site

"Error Details: The Jetpack server was unable to communicate with your site...

Create Static Files with your WordPress Install

Reduce the processor and memory load of your site but publishing it into html files.Use the...

Elementor - Critical Error with both Elementor and Elementor Pro plugins enabled

Running Elementor and Elementor Pro simultaneously can be memory-intensive. Elementor and...