How to Exclude Selected JS and CSS files from Minification

By | November 4, 2015

The speed of a particular website can be easily determined by its Server Response Time and also the page load speed. The best way to measure how fast the content loads on your page is through the Page Speed. There are various ways through which one can easily increase the page speed. Other search engines and Google evaluates your site by considering these factors. If your website is taking too long to load a particular page then there are chances for them to move on because there are no visitors who will wait too long.

Ways to increase the Page Speed:

There are different factors and ways that can help to increase the page speed of the particular website. To list some of them:

  1. Optimizing the database
  2. Enabling compression
  3. Minify JS and CSS files
  4. Improving Server Response time
  5. Speed Comparison by different tools
  6. Using Content distribution network (CDNs)

These are some of the factors that will decide page speed and also help to increase the Page Speed of the particular website. Among these factors mentioned, one of the important factor that is use to increase the page speed of the website is excluding selected JS and CSS files from minification.

Minification of Code:

Code minification is the removal of unnecessary characters from the source code. The main purpose of minification is to make the source code smaller that will help to improve the performance. Minification of code will help to improve the page loading speed and that will help to attract more customers to your site. Even though there are some of the code that is removed from the source code but this will not change the functionality of the code.

In the same way to improve the page speed of the WordPress site, one can easily minify the JS and CSS files or one can also exclude them. There are various WordPress Plugins that will help you to minify these files.

WordPress Plugins to minify JS and CSS files:

Optimizing ones site is very easy through this plugin. All the scripts and styles are concatenated, minifies and compresses them, expires headers are added, caches them and then the styles are moved to the page head and scripts are moved to the footer. It also includes some of the advanced options and also minifies the HTML code itself. It will speed up your website and helps to save the bandwidth by aggregating and minimizing JS, CSS and HTML.


It combines and minify the CSS and JS files to improve the page load time. It uses the PHP library minify and also relies on WordPress’s enqueueing system. It is very customizable and also very easy to use. It supports various features and to highlight a few of them includes: One can change various Minify settings directly in admin, allows to use the friendly Minify URLs, uses CDN for the minified contents, splitting of long Minify strings into shorter ones, WordPress multi site compatible and much more…


Minify engine is used by this plugin to combine and compress JS and CSS files to improve the page load time. This plugin is a fork of WP Minify to fix the bug and to add features. Some of its features includes: easily integrating Minify to the WordPress blog, Debug tools used in order to debug the issues, Ability to include and exclude extra JS and CSS files for Minifying, detection and elimination of duplicate sources, plugin hooks and many more.


It is one of the light weight plugin that combines, minifies and caches inline JavaScript and CSS files on demand to speed up page loads. When this plugin is activated then one will see the source of the HTML, inline JavaScript and CSS that are compressed and thus the size of it will be smaller and that will be helpful to improve the page load speed.


This plugin cleans up number of issues improves speed, efficiency, security, SEO and also the user experience. It also helps to remove the junk code from the document HEAD and HTTP headers, combines/ minifies/ caches CSS and JavaScript files. It minifies and caches your site’s CSS and JavaScript files into single gzip compressed file that will even help for better speed improvements in page loading.


The above plugins will to minify selected CSS and JS files that will improve the page load speed of your website.

Exclude Selected JS and CSS Files

These plugins offer an option to exclude certain JS and CSS files. Sometimes you may find some issues when the minification is done as some components stop working. In such cases, you can find out the conflict and ask the plugin to exclude or ignore few JS files. For example, in case of Autoptimize plugin, there is an option as “Show Advance Settings” on the settings page. Here you can mention the script or CSS names and exclude the same.


Similar options you can find in other minify plugins as well. It helps in fixing the plugin conflicts as well as keeping the site optimized.

Related Post