W3 Total Cache Minify Settings – Website Maintenance Tip

W3 Total Cache is now packed full of great features to improve your websites performance and overall website maintenance of your website. In this article I will show how to correctly setup the minify settings in W3TC to increase performance and Google PageSpeed Insights. This will give you a better user experience and search engine rankings with these minify settings.

Please note that these settings do not apply to all WordPress themes. There is a lot of trial and error in getting the right minify settings for your theme. I will explain which sections may cause problems, which will allow you to delete these sections and tweak them slightly to get the best results for your website.

To start with run a website performance test and Google PageSpeed Insights test and make a note of the results.

 

Can I Do This Myself?

 

Importance: 88%

Difficulty: 73%

Time Required: 39%

[button title=”NEED HELP?”┬ástyle=”outline” size=”large” link=”url:https%3A%2F%2Fsixtymarketing.com%2Fp%2Fseo-maintenance-package%2F|title:website%20maintenance%20packages|” animation=”bounceIn”]

 

Version 0.9.5.1 Update

The latest W3 Total Cache update (version 0.9.5.1) allows you to turbo charge your website performance and load speed far greater than previous versions. You may have noticed some changes when you updated W3TC, mainly in the ‘Performance’ tool bar at the top of your dashboard.

W3TC Purge All Cache - Website Maintenance

This is what you need to select now once you make important updates instead of ‘Clear All Caches’ that was previously there.

Another main update to W3TC is the minify settings in this version. This allows you to solve many WordPress speed issues with the biggest pain in the arse being Defer parsing of JavaScript. This is one of the main factors we will be talking about in this article.

If you follow all the below settings in the correct order you will see a huge improvement in website performance and a decrease in your websites load speed. It is important you follow the below step as there are no universal setting for every WordPress website.

 

General Settings > Minify

Now lets get the ball rolling! Log in to your WordPress dashboard and on the left hand side go to:

PERFORMANCE > GENERAL SETTINGS

Now scroll down to the MINIFY section. Make sure you have the below settings to have the optimal performance:

  • Minify: Enable
  • Minify Mode: Manual
  • Minify Cache Method: Disk
  • HTML Minifier: Minify (default)
  • JS Minifier: JSMin (default)
  • CSS Minifier: Minify (default)
  • Click ‘Save Settings & Purge Cache’

W3TC General Settings > Minify - Website Maintenance Tip

 

Minify > General

Now make your way over to the below section by going to:

PERFORMANCE > MINIFY

We will start by making sure the General section is completed first by having the below settings:

  • Rewrite URL structure: Check
  • Disable minify for logged in users: Uncheck
  • Minify error notification: Disabled
  • Click ‘Save Settings & Purge Cache’

 

Minify > HTML & XML

Scroll down to the next section HTML & XML and apply the below:

For the HTML minify settings:

  • Enable: Check
  • Inline CSS minification: Check
  • Inline JS minification: Check
  • Don’t minify feeds: Check
  • Line break removal: Uncheck
  • Click ‘Save Settings & Purge Cache’

W3TC Minify HTML & XML Settings - Website Maintenance Tip

 

Minify > JS

Scroll down to the JS section. Now this section needs to be done in two parts. To start with apply the below settings:

  • JS minify settings: Enabled
  • Before </head>: Minify – Non-blocking using “async”
  • Before <body>: Minify – Non-blocking using “async”
  • Before </body>: Minify – Non-blocking using “async”
  • Preserved comment removal: Uncheck
  • Line break removal: Uncheck
  • JS file management: Theme – (select your active theme)
  • Click ‘Save Settings & Purge Cache’

Now stay at the top of the PERFORMANCE > MINIFY page and click on the HELP button.

W3TC Minify JS Settings - Website Maintenance Tip

A pop up window will come up looking like the below displaying all your JavaScript (also your CSS but we will do this in your next step).

W3TC Minify JS Help Settings - Website Maintenance Tip

Please note: before you start this section create a backup of your website. There maybe a small chance these settings may interrupt the loading of your website. It is a very easy fix but were just covering ourselves!

We know that if you run woocommerce your site wont run correctly so uncheck any woocommerce related file.

As mentioned previously, this is going to be trial and error to find the correct settings to suit your theme and plugins. To start with select all the JS files by checking the boxes. Do not check the CSS boxes yet. Click Apply & Close then ‘Save Settings & Purge Cache‘.

 

Minify > CSS

Go to the CSS section and apply the below:

CSS minify settings:

  • Enable: Check
  • Combine only: Uncheck
  • Preserved comment removal: Uncheck
  • Line break removal: Check
  • : Uncheck
  • @import handling: Uncheck
  • CSS file management: Theme – (select your active theme)
  • Click ‘Save Settings & Purge Cache’

W3TC Minify CSS Settings - Website Maintenance Tip

Now stay at the top of the PERFORMANCE > MINIFY page and click on the HELP button.

W3TC Minify JS Settings - Website Maintenance Tip

A pop up window will come up looking like the below displaying all your CSS script.

W3TC Minify JS Help Settings - Website Maintenance Tip

Please note: before you start this section create a backup of your website. There maybe a small chance these settings may interrupt the loading of your website. It is a very easy fix but were just covering ourselves!

We know that if you run woocommerce your site wont run correctly so uncheck any woocommerce related file.

As mentioned previously, this is going to be trial and error to find the correct settings to suit your theme and plugins. Click Apply & Close then ‘Save Settings & Purge Cache‘.

 

Minify > Advanced

Leave these settings as they are (default).

 

Website Maintenance Checks & Tests

Ok, now you have applied these settings we need to test them. Start by purging you cache as below:

W3TC Purge All Cache - Website Maintenance

You may have to wait a few minutes for your headers to propagate. Clear your browser cache and wait 5-10 minutes before visiting your website again.

Now visit your website and go through every web page to ensure it loads and functions as it should. If all is good, run your website performance test and Google PageSpeed Insights test again to view your improvements.

If you are having problems then you need to identify what JS or CSS is causing the problem. This is usually pretty straight forward to pickup as its usually a section that doesn’t load. Just go back to PERFORMANCE > MINIFY > JS and CSS then delete the appropriate line of code. Then ‘Save Settings & Purge Cache’.

This is where the trial and error part come into play as i mentioned. This does require a high level of WordPress experience of what the source of the problem is. If you require any help with this section we provide a WordPress website maintenance service to help fix and delete these lines of code for you.

You will never get the perfect Google PageSpeed score, especially with WordPress but this does not effect your Google rankings and SEO if there are only a few errors remaining.

Your minify section plays a huge role in your website maintenance and it should be kept on top of regularly. Every time you apply a new plugin or theme you need to repeat the sections from Minify > JS onward as laid out above. This will keep your website performing well, reduce your load speed and produce an increase in Google rankings.