Skip to Main Content

W3TC plugin configuration: Minifications configuration - Episode 4

Divi: the easiest WordPress theme to use

Divi: The best WordPress theme of all time!

With over 701.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]

We continue today our tutorial on W3TC. You probably already know that it's a cache plugin, which allows you, among other things, to speed up your blog (improves its performance).

This tutorial is broken down into several parts. We have since started with the introduction to the cache and made some preliminary adjustments. You can see the different chapters below:

Part 2: Configuring minification

We are still in the configuration W3TC, but now let's talk about file compression.

Before accessing the menu Minify ", You must first activate" Minify In the general settings. If you have enabled the compression mode, and if it works properly on your site, then the settings for " minification That you see in this menu will be a simplified version of what is shown in the screenshots below.

In this tutorial, we cover the compression process ( minifying ) with W3TC. The " minification And the combination of JS and CSS are the essence of what we will see in this tutorial.

Minify: General

General settings in the menu Minify Has three options.

minify-general-w3tc-plugin-wordpress

The module " URL Rewrite "Should be enabled by default and you should leave this option as such, unless you prefer to see your CSS and JS files fetched using" http GET "headers rather than the normal URL structure.

Disable " minification For logged in users should not be changed. It is recommended not to provide logged in and disconnected users with different CSS and JS files.

Error notification " Minify Must be set for administrator notifications. This will allow them to be informed when there is an error.

The following sections " All minify ", Combine and move the" page components "option. This can break the presentation of your site. You should enable preview mode and keep an eye on your site as you make changes to make sure you don't damage your site layout.

Easily create your website with Elementor

Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]

Minify: HTML & XML

The section " HTML and XML From the Minify menu is simple. The checkboxes are intended to allow " minification ", of the' " inline CSS and JavaScript, omit minification streams, and allow breaking newlines.

minify-html-w3tc

With the exception of the option " Do not minify feeds Which must remain unchecked, your site speed should improve.

The text box of Ignored comments steams Is used to identify HTML comments that should not be removed when HTML is "compressed". Some linked comments will be in this domain by default in order to ensure that comments associated with Google AdWords and readers are not deleted. If your HTML code contains additional comments and you want to stay in the " minified Of HTML, add a term in this text box, so any comments with this expression will not be deleted.

Minify JS

If you have enabled compression JavaScript & CSS " in the menu " General Settings You will only be able to work with all the JavaScript resources at once and the menu you see will be a simplified version of the image below.

minify-js-w3tc

If you have selected the manual method, you must scroll to the top of the menu Minify And select the wizard button. The latter lists the JavaScript and CSS files detected by W3TC. Select check all boxes for both JavaScript and CSS file types and click on " Apply And close. This will add the JavaScript and CSS files in the menu " Minify So that you can work with these manually.

Look at the box named " Operation in areas ". In this section, you can control whether JavaScript resources are " minified And combined with the option Minify Or if they are simply combined. The type " Embed Offers some options on how JavaScript resources are loaded. You can try each of the options of " nonblocking Until you find one that doesn't break your site's presentation, but if none of the options work, leave the defaults.

Are you looking for the best WordPress themes and plugins?

Download the best plugins and WordPress themes on Envato and easily create your website. Already more than 49.720.000 downloads. [EXCLUSIVE]

If you have selected the manual compression method in the general settings, you can work with each file individually by assigning it to a single template or to all templates and moving it to the " header ", the " body "Or below" body For granular control over where each file appears in the HTML document and how it is loaded. You can also " drag and drop »Files, to rearrange the order in which they are loaded in case some files depend on previous files to load correctly.

minify-js-compression

The optimal setting is to move the files from " header And load them one of the options of nonblocking "(Non-blocking). However, there is a very good chance that by doing this, the appearance of your site will be affected.

There is really no way around this by going through each file once, testing them in different places, and making sure the site loads correctly.

Minify CSS

There are four settings to reduce the available CSS files:

minification-css options

  • Enable : Enables minfication and the combination of CSS files.
  • combine only : Combine CSS files, but do not belittle them.
  • Preserved how removal : Removes comments from combined CSS files.
  • Line break removal: Removes newlines in combined CSS files.

Start by selecting all options except for " combines Only ". If the presentation of the site is different, uncheck " Preserved how removal "And" Line break removal ". If that does not correct the site, then use " combines Only ».

For the @import option, select " Process ».

If you selected " Car As a method of minification "General settings, then you will only see the first two sections of this menu. However, if you have the minification Manual, then you will see a CSS file management section.

If you haven't already added CSS files that will be managed, select the "Help" wizard, and select all the CSS files for your themes. Then rearrange the order of the files so that the most critical files are loaded first.

Easily create your Online Store

Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]

Minify: Advanced settings

In most cases, the default settings in the advanced section do not need much editing. However, you can use them to adjust the frequency with which JavaScript and CSS files are updated, the frequency with which expired files are deleted from the cache, and more.

tuning-of-the expiration des-files w3tc

The advanced section includes three fields to exclude specific pages, JS files and CSS files from the " minification ". If you find that some JS or CSS resources should never be compressed, you can isolate them by adding them to these domains. If you need help with the correct syntax, see " Use: General From the FAQ for instructions.

That's it for the minification options on W3 Total Cache, we will continue with the database cache.

This article features 8 comments

  1. Hello, thank you for your explanations! However, I still cannot solve a problem: By doing an analysis with 'Pagespeed Insights' I found several errors (css resources which blocked my page) that I managed to solve by following your instructions indicated on this page. However there is 1 css file which still blocks the display and I cannot modify it because I cannot find it in the Minify menu. Could you help me ?

  2. Hi

    Thank you for this article very thorough about W3TC
    I have a question. Yesterday, I updated my W3TC plugin which I have been using for a very long time and which has never given me a problem. Immediately I was unable to access WP-admin.
    I managed to disable the plugin on FTP without going through WP-admin. And I regained my access to WP-admin

    What do I conclude from all this?
    Should I abandon W3TC?
    Should I reinstall following your settings (mine were perhaps obsolete and update the sanctioned)
    If I have to choose another cache plugin. Which one do you advise me?
    Thank you for your answers

    1. Hello,
      So just having W3TC disabled by FTP doesn't necessarily mean it's the cause. Perhaps the latter (since he has never betrayed you) has encountered a conflict which is the cause of your problem.
      I suggest you give the plugin another chance. But making sure you have fallbacks in case another problem arises. By fallback I am referring to backups of your blog.

      Thank you

      1. Herve thank you

        In fact, I believe the real maintainer is not W3TC (which I am about to reinstall) but WPtouch. I then remembered that 2 updates were necessary

        When I install WPtouch
        this is what I get:

        The extension could not be activated because it triggered a fatal error.
        Parse error: syntax error, unexpected T_STRING in /home/aproposd/www/wp-content/plugins/wptouch/core/class-cache-smash.php on line 104

        I do not know what that means
        It's annoying
        thank you for your reply

        1. Hi,
          there is a syntax problem in the "class-cache-smash" file of the wptouch plugin. I invite you to update if it is available, as you will not be able to use this plugin unless you ask for a quick service to fix this error.

      2. Okay good ... I just installed W3TC and here is the message I get ...

        The extension could not be activated because it triggered a fatal error.

        Parse error: syntax error, unexpected T_STRING in /home/aproposd/www/wp-content/plugins/w3-total-cache/w3-total-cache.php on line 65

        What should I do ? Can you help me ... it's hopeless

        1. Hi Marie, I'm sorry to hear that you haven't solved your problem yet. We can help you, request personalized assistance via live chat on the home page of the site. We will give prompt help to your problem.

Leave a comment

Your email address will not be published. Required fields are marked with *

This site uses Akismet to reduce unwanted. Learn more about how your comments data is used.

Back To Top
2 shares
Share
tweet
Save2