{"id":9848,"date":"2020-07-29T15:00:50","date_gmt":"2020-07-29T13:00:50","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=9848"},"modified":"2022-02-17T11:04:10","modified_gmt":"2022-02-17T10:04:10","slug":"minify-css-javascript-files-in-wordpress","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/minify-css-javascript-files-in-wordpress\/","title":{"rendered":"How to Minify CSS and Javascript Files in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]If you ever explored the best ways to optimize your website, you have probably come across the terms <em>minify<\/em> or <em>minification<\/em>. The term minify refers to methods used to reduce the size of the files on your website. This is accomplished by removing white spaces, lines, and unnecessary characters from the source code.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, we will explain what minification encompasses, what its benefits are, and some of the most popular minification solutions. From there you will be able to decide the best way to tackle performance and speed improvements for your website.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"what-is-infinite-scroll\"><\/a>What is Minification?<\/h2>\n<p>[\/vc_column_text][vc_column_text]Websites are made up of many different files arranged in folders located on the server. Those files contain code that determines the appearance and functionality of your site. In order to make your site light-weight and fast-loading, the code it\u2019s using needs to be optimized. Specifically, your JavaScript and CSS code. Minifying your files is one way to accomplish that. If you ever tried testing the speed of your website using <a href=\"https:\/\/gtmetrix.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">GTmetrix<\/a> or <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\/\" target=\"_blank\" rel=\"noopener noreferrer\">PageSpeed \u200b\u200bInsights<\/a>, you likely got a recommendation to minify some of your site files\u2014namely, the CSS and JavaScript ones.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]When we check the code in a website\u2019s files we all expect that it\u2019s written in an understandable way to make it easier to interpret. However, the <strong>computers that execute that code don\u2019t care if the files contain comments, formatting, white space, or new lines<\/strong>. When they come across any unnecessary characters in the website files, they just ignore them\u2014only the code that needs to be executed matters.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]This is when minification enters the scene. <strong>Minification is a computing term<\/strong> that basically means <strong>removing superfluous characters<\/strong>, those that aren\u2019t needed to execute the written code. Minification works by analyzing and rewriting the code. <strong>This reduces the overall size of the files<\/strong> and, by extension, the size of the website itself, so it can load faster in the user&#8217;s browser.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]For example, if you have a stylesheet file intended to style your website with CSS code that looks a bit like this:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/1-Stylesheet-file-intended-to-style-your-website-2.jpg\" class=\"attachment-full size-full\" alt=\"Stylesheet file intended to style your website\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/1-Stylesheet-file-intended-to-style-your-website-2.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/1-Stylesheet-file-intended-to-style-your-website-2-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/1-Stylesheet-file-intended-to-style-your-website-2-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Its minified version would look like this:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/2-Minified-version.jpg\" class=\"attachment-full size-full\" alt=\"Minified version\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/2-Minified-version.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/2-Minified-version-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/2-Minified-version-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]As you can see the difference is significant\u2014the minified version is in one line and <strong>takes up far less space<\/strong> than the original version of the code.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Minification takes place on the web server before a response to a client&#8217;s (web browser&#8217;s) request is sent. <strong>After minification, the web server uses smaller, minified, and much faster CSS and JavaScript files<\/strong> instead of the original ones. This results in improved page loading speed without losses to functionality.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">How to Minify Your WordPress CSS and JavaScript Files<\/h2>\n<p>[\/vc_column_text][vc_column_text]Before you start minifying your website files, we recommend that you first <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-manually-backup-wordpress-website\/\">back up the entire website<\/a> or just <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-backup-wordpress-files\/\">make a backup of individual files<\/a>. Also, if you have a <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-setup-wordpress-staging-site\/\">staging site<\/a> or a local test environment, it would be good to first minify your website files there. That way you can <strong>check if everything is working properly before you make changes to the live site<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Moreover, you should check the <strong>page speed of your website before and after minifying the files<\/strong>. Then compare the results and see if the minification has helped with improvement. You can do this using GTmetrix; it\u2019s a very useful testing tool that generates results and gives <strong>recommendations for website optimization<\/strong> improvements.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To minify files, you can use a plugin or do it manually with an online tool. We\u2019re going to explain both those methods in more detail in the sections below.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\">Minifying Files Using Plugins<\/h3>\n<p>[\/vc_column_text][vc_column_text]Using a WordPress plugin for minification is the <strong>easiest way to minify <a href=\"https:\/\/qodeinteractive.com\/magazine\/eliminate-render-blocking-resources\/\">CSS and JavaScript<\/a> files<\/strong> on your website. The most commonly used plugins are:[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Autoptimize<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/3-Autoptimize-Plugin.jpg\" class=\"attachment-full size-full\" alt=\"Autoptimize Plugin\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/3-Autoptimize-Plugin.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/3-Autoptimize-Plugin-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/3-Autoptimize-Plugin-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<a href=\"https:\/\/wordpress.org\/plugins\/autoptimize\/\" target=\"_blank\" rel=\"noopener noreferrer\">Autoptimize<\/a> is one of the more popular plugins for minification that you can find. It is very easy to use and offers a lot of possibilities, and on top of that, it\u2019s free. This plugin can <strong>combine scripts, minify, and cache your code<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Download and install this plugin via the WordPress admin panel. When you activate it, find the <strong>Settings &gt; Autoptimize option<\/strong>, and in the optimization options <strong>tick the boxes for the CSS and JavaScript options<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/4-Autoptimize-option.jpg\" class=\"attachment-full size-full\" alt=\"Autoptimize option\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/4-Autoptimize-option.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/4-Autoptimize-option-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/4-Autoptimize-option-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]You will also notice additional options below for optimizing these files. You can activate them and <strong>additionally customize file minification<\/strong>. In the end, all you have to do is <strong>click the <em>Save Changes and Clear Cache<\/em> button<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<strong>Fast Velocity Minify<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/6-Fast-Velocity-Minify.jpg\" class=\"attachment-full size-full\" alt=\"Fast Velocity Minify\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/6-Fast-Velocity-Minify.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/6-Fast-Velocity-Minify-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/6-Fast-Velocity-Minify-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<a href=\"https:\/\/wordpress.org\/plugins\/fast-velocity-minify\/\" target=\"_blank\" rel=\"noopener noreferrer\">Fast Velocity Minify<\/a> is another popular, free, and useful plugin. It works by <strong>minifying and combining your CSS and JavaScript files<\/strong> to reduce the HTTP requests to your server. It merges the files into a group and tries to use as few of them as possible. There are <strong>additional optimization options available<\/strong>, but the default settings are enough for most websites.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]When you install and activate this plugin,<strong> your website files will automatically be minified and optimized<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You can use <strong>the <em>Settings &gt; Fast Velocity Minify<\/em> option<\/strong> in the admin panel to access the plugin settings and <strong>check all available options<\/strong>. Under the Status tab, you can <strong>see a list<\/strong> of JavaScript and CSS files that Fast Velocity Minify processed.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/7-Fast-Velocity-Minify-option.jpg\" class=\"attachment-full size-full\" alt=\"Fast Velocity Minify option\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/7-Fast-Velocity-Minify-option.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/7-Fast-Velocity-Minify-option-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/7-Fast-Velocity-Minify-option-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]And you can use the <em>Settings<\/em> tab to <strong>tailor how your files will be optimized<\/strong>. Since grouping CSS and JavaScript is enabled by default, after activating the plugin you can use the settings to <strong>adjust the default options or disable minification<\/strong> for certain types of code. You even have the <strong>option to optimize Google Fonts and Font Awesome icons<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/8-Optimize-Google-Fonts-and-Font-Awesome-icons.jpg\" class=\"attachment-full size-full\" alt=\"Optimize Google Fonts and Font Awesome icons\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/8-Optimize-Google-Fonts-and-Font-Awesome-icons.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/8-Optimize-Google-Fonts-and-Font-Awesome-icons-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/8-Optimize-Google-Fonts-and-Font-Awesome-icons-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<strong>WP Super Minify<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/9-WP-Super-Minify.jpg\" class=\"attachment-full size-full\" alt=\"WP Super Minify\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/9-WP-Super-Minify.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/9-WP-Super-Minify-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/9-WP-Super-Minify-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<a href=\"https:\/\/wordpress.org\/plugins\/wp-super-minify\/\" target=\"_blank\" rel=\"noopener noreferrer\">WP Super Minify<\/a> is a minification plugin that can minify, combine, and cache your website\u2019s CSS and JavaScript files.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]After activating this plugin, it will automatically compress all inline JavaScript and CSS code. So <strong>the file size will be smaller<\/strong> which will help to improve the loading speed of your website. Using <strong>the <em>Settings &gt; WP Super Minify<\/em> option<\/strong>, you can <strong>choose whether to minify both JavaScript and CSS or just one<\/strong> of those two file types.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/10-WP-Super-Minify-Settings.jpg\" class=\"attachment-full size-full\" alt=\"WP Super Minify Settings\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/10-WP-Super-Minify-Settings.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/10-WP-Super-Minify-Settings-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/10-WP-Super-Minify-Settings-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]To make sure this plugin is working properly, simply <strong>examine your website\u2019s source code<\/strong>. The easiest way to do this is by <strong>opening your site in a browser<\/strong> and pressing Ctrl + U (for Windows) or Option + Command + U (for Mac). If everything is alright, you should see the following message at the end of the source code:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/11-Message-at-the-end-of-the-source-code.jpg\" class=\"attachment-full size-full\" alt=\"Message at the end of the source code\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/11-Message-at-the-end-of-the-source-code.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/11-Message-at-the-end-of-the-source-code-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/11-Message-at-the-end-of-the-source-code-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Ultimately, whichever plugin you choose to use, all you need to do is select the files you want to minify and <strong>the plugin will do all the work for you<\/strong> in the background. Every minification plugin on the market <strong>offers different functions in addition to minification<\/strong>, so you should try several plugins and choose the one that suits you best.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Furthermore, minification is a virtually standard feature of <strong>caching plugins<\/strong>, such as <a href=\"https:\/\/wordpress.org\/plugins\/w3-total-cache\/\" target=\"_blank\" rel=\"noopener noreferrer\">W3 Total Cache<\/a> and <a href=\"https:\/\/wordpress.org\/plugins\/wp-super-cache\/\" target=\"_blank\" rel=\"noopener noreferrer\">WP Super Cache<\/a>. So you can try using them as well to minify your website\u2019s CSS and JavaScript files.[\/vc_column_text][vc_empty_space height=&#8221;81px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_separator color=&#8221;custom&#8221; accent_color=&#8221;#f0f0f0&#8243;][vc_empty_space height=&#8221;50px&#8221;][vc_widget_sidebar sidebar_id=&#8221;top-picks-banner&#8221;][vc_empty_space height=&#8221;28px&#8221;][vc_separator color=&#8221;custom&#8221; accent_color=&#8221;#f0f0f0&#8243;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Minifying Files Manually<\/h2>\n<p>[\/vc_column_text][vc_column_text]Firstly, manually minifying files does not mean that you manually go through every file on your website and remove white or empty spaces. Manual minification actually involves <strong>using one of the popular online tools<\/strong> for this purpose. One of them is <a href=\"http:\/\/minifycode.com\/css-minifier\/\" target=\"_blank\" rel=\"noopener noreferrer\">Minify Code<\/a>, which we\u2019re going to use to show the steps you\u2019d need to take to minify your code. This tool has a pretty <strong>simple and user-friendly interface<\/strong>. And many online tools of this type have a similar, or same, procedure for minification. Here are a few you can try out:[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"https:\/\/cssminifier.com\/\" target=\"_blank\" rel=\"noopener\">CSS Minifier<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"https:\/\/javascript-minifier.com\/\" target=\"_blank\" rel=\"noopener\">JavaScript Minifier<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"https:\/\/csscompressor.net\/\" target=\"_blank\" rel=\"noopener\">CSS Compressor<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"https:\/\/jscompress.com\/\" target=\"_blank\" rel=\"noopener\">JSCompress<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"https:\/\/www.minifier.org\/\" target=\"_blank\" rel=\"noopener\">Minify<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you choose to use the Minify Code tool, first you need to <strong>select the tab you need<\/strong>. Depending on which code you want to minify, there is a tab for CSS minifier and <em>JavaScript minifier<\/em>. After deciding, <strong>paste your code<\/strong> in the available window and <strong>press the <em>Minify<\/em> button<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/12-Minifying-files-manually.jpg\" class=\"attachment-full size-full\" alt=\"Minifying files manually\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/12-Minifying-files-manually.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/12-Minifying-files-manually-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/12-Minifying-files-manually-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]After a few moments, you will see the <strong>minified version of the code<\/strong> you entered. You can simply copy it and transfer it to your original file. Just a reminder\u2014be sure to <strong>back up your files before<\/strong> overwriting the original code with the minified one.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/13-Minified-version-of-the-code.jpg\" class=\"attachment-full size-full\" alt=\"Minified version of the code\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/13-Minified-version-of-the-code.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/13-Minified-version-of-the-code-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/07\/13-Minified-version-of-the-code-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Manual minification is primarily useful <strong>if you want to minify only certain files or some code you\u2019ve written<\/strong>. For example, if you are <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-create-child-theme\/\">using a child theme<\/a> to customize your website, then the CSS file with your <a href=\"https:\/\/qodeinteractive.com\/magazine\/add-custom-javascript-to-wordpress\/\">custom code<\/a> would be a good candidate for minification. In that case, you can make a backup of the original file, then <strong>use the online tool to minify its code and replace it directly in the file<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you decide to change something later, you can always do <strong>it in the backup file you saved<\/strong>. Minify it again with the changes made and replace the code in the file on the server. That way <strong>you\u2019ll always have a ready backup file that you can edit<\/strong> and the minified file will be on the server doing its bit to optimize your site as much as possible.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final Thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]If you want to improve the performance of your website and achieve better page loading speeds, then minifying CSS and JavaScript files will go a long way in helping you. Using minifying tools available online, you\u2019ll be able to easily minify your website\u2019s code. Moreover, with WordPress websites, you can always install one of the many plugins on the market and with just a few clicks automatically minify CSS and JavaScript files. If you\u2019re already using a caching plugin, you can check if it has any minification options in its settings and use it instead of adding a bunch of new plugins.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]There are multiple options you can use to minify CSS and JavaScript files, you just need to decide which one is best for you. We hope you found this article helpful and that, by employing our advice, your optimized site will soon rise in the rankings.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Follow this tutorial and learn several methods to minify CSS and Javascript files in WordPress, which will help improve your site&#8217;s speed and performance.<\/p>\n","protected":false},"author":10600,"featured_media":9870,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,4,13],"class_list":["post-9848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-core","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/9848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/10600"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=9848"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/9848\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/9870"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=9848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=9848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=9848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}