{"id":5196,"date":"2017-03-27T18:19:51","date_gmt":"2017-03-27T12:49:51","guid":{"rendered":"https:\/\/weblizar.com\/?p=5196"},"modified":"2025-08-13T10:48:56","modified_gmt":"2025-08-13T05:18:56","slug":"minify-css-javascript-files","status":"publish","type":"post","link":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/","title":{"rendered":"How To Minify CSS And JavaScript Of Your WordPress Website"},"content":{"rendered":"<p>Do you want to minify files on your WordPress site? Minifying your WordPress CSS and Javascript files can make them load faster and speed up your WordPress site. So, lets see how to minify css and javascript of your website.<\/p>\n<h2>Why Minify CSS And JavaScript?<\/h2>\n<p>SEO is an important aspect for any webmaster since good ranking in the search engine assures heavy traffic to your website thus gaining lot of profit at the end of the day. To attain better rankings, there are some important ranking factors of SEO to be taken care of and speed of your website is definitely one of them. To make sure that your site load faster whenever any user is visiting your website, you need to comply to all specified set of rules and regulation those are predefined by search engine giants such as Google or Bing.<\/p>\n<p>Minifying CSS \/ JavaScript of your website is certainly one of the factors which helps improving your website overall speed. In this guide, we will show you how to minify CSS\/Javascript files in WordPress to improve performance and speed.<\/p>\n<h4>What is Minify and When Do You Need it?<\/h4>\n<p>The term \u2018Minify\u2019 is used to describe a method which makes your website file size smaller. It achieves this goal by removing white spaces, lines, and unnecessary characters from the source code.<\/p>\n<p>Usually it is recommended to be used only for files that are sent to user\u2019s browsers. This includes HTML, <a title=\"What is CSS? How to Use CSS in WordPress?\" href=\"https:\/\/www.wpbeginner.com\/glossary\/css\/\">CSS<\/a>, and <a title=\"What is JavaScript? How to Use JavaScript in WordPress?\" href=\"https:\/\/www.wpbeginner.com\/glossary\/javascript\/\">JavaScript<\/a> files. You can minify <a title=\"What is PHP? How WordPress Uses PHP?\" href=\"https:\/\/www.wpbeginner.com\/glossary\/php\/\">PHP<\/a> files too, but PHP is a server-side programming language and minifying it will not improve page load speed for your users.<\/p>\n<p>The obvious advantage of minifying files is <a title=\"The Ultimate Guide to Boost WordPress Speed &amp; Performance\" href=\"https:\/\/www.wpbeginner.com\/wordpress-performance-speed\/\">improved WordPress speed and performance<\/a>. Compact files are faster to load and improve your site\u2019s speed.<\/p>\n<p>However, some experts believe that the performance improvement is very small for most websites and not worth the trouble. The minification only decreases few kilobytes of data on most WordPress sites. You can reduce more pageload time by simply <a title=\"Speed Up Your WordPress \u2013 How to Save Images Optimized for Web\" href=\"https:\/\/www.wpbeginner.com\/beginners-guide\/speed-wordpress-save-images-optimized-web\/\">optimizing images for web<\/a>.<\/p>\n<p>Here is an example of normal CSS code:<\/p>\n<div class=\"grey-box\">body {<br \/>\nmargin:20px;<br \/>\npadding:20px;<br \/>\ncolor:#333333;<br \/>\nbackground:#f7f7f7;<br \/>\n}<br \/>\nh1 {<br \/>\nfont-size:32px;<br \/>\ncolor#222222;<br \/>\nmargin-bottom:10px;<br \/>\n}<\/div>\n<style>.grey-box {background: #F7F7F7;margin: 5px 15px 15px 15px;padding: 10px 20px 0 15px;border: 1px solid #E6E6E6;word-wrap: break-word;}<\/style>\n<p>After minifying the code it will look like this:<\/p>\n<div class=\"grey-box\">body{margin:20px;padding:20px;color:#333;background:#f7f7f7}h1{font-size:32px;margin-bottom:10px}<\/div>\n<style>.grey-box {background: #F7F7F7;margin: 5px 15px 15px 15px;padding: 10px 20px 0 15px;border: 1px solid #E6E6E6;word-wrap: break-word;}<\/style>\n<p>If you are trying to achieve 100\/100 score on Google Pagespeed or <a title=\"How to Use GTMetrix Plugin to Improve WordPress Site Performance\" href=\"https:\/\/www.wpbeginner.com\/plugins\/how-to-use-gtmetrix-plugin-to-improve-wordpress-site-performance\/\">GTMetrix tool<\/a>, then minifying CSS and JavaScript will significantly improve your score.<\/p>\n<p>Having said that let\u2019s take a look at how to easily minify CSS\/JavaScript on your WordPress site.<\/p>\n<h4>Minify CSS\/Javascript in WordPress<\/h4>\n<p>First thing you need to do is install and activate the <a title=\"Better WordPress Minify\" href=\"https:\/\/wordpress.org\/plugins\/bwp-minify\/\" target=\"_blank\" rel=\"nofollow noopener\">Better WordPress Minify<\/a> plugin.<\/p>\n<p>Upon activation, the plugin will add a new menu item labeled \u2018BWP Minify\u2019 to your WordPress admin bar. Clicking on it will take you to plugin\u2019s settings page.<\/p>\n<p><a href=\"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/bwpminify-settings-customize.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5199\" src=\"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/bwpminify-settings-customize.png\" alt=\"bwpminify settings admin panel image\" width=\"550\" height=\"383\" \/><\/a><\/p>\n<p>On the settings page, you need to check the first two options to automatically minify JavaScript and CSS files on your WordPress site.<\/p>\n<p>You can now click on the Save Changes button to store your settings.<\/p>\n<p>There are many other advanced options on this page. The default settings will work for most websites, but you can review and change these options on a case by case basis.<\/p>\n<p>Next, you need to head over to your website. Right click anywhere and then select \u2018View Page Source\u2019 from browser menu.<\/p>\n<p><a href=\"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/bwpminify-plugin-viewpagesource.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5200\" src=\"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/bwpminify-plugin-viewpagesource.png\" alt=\"bwpminify plugin viewpagesource\" width=\"550\" height=\"298\" \/><\/a><\/p>\n<p>You will now see the HTML source code generated by your WordPress site. If you look closely, you will notice that this plugin will load CSS\/JavaScript files from plugin\u2019s own folder instead of your WordPress themes and plugins.<\/p>\n<p>These are the minified versions of your original CSS and JavaScript files. Better WordPress Minify plugin will keep them cached and serve the minified versions to browsers.<\/p>\n<p>That\u2019s all, we hope this article helped you learn how to minify your WordPress site. You may also want to see our ultimate guide on how to speed up WordPress for beginners.<\/p>\n<p>If you liked this article, then please subscribe to our <a title=\"WPBeginner on YouTube\" href=\"https:\/\/www.youtube.com\/channel\/UCFve0DTmWU4OTHXAtUOpQ7Q\" target=\"_blank\" rel=\"nofollow noopener\">YouTube Channel<\/a> for WordPress video tutorials. You can also find us on Twitter and <a title=\"WPBeginner on Facebook\" href=\"https:\/\/www.facebook.com\/weblizardotcom\" target=\"_blank\" rel=\"nofollow noopener\">Facebook<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class=\"single-detail-box\">Hope you are enjoying our blog posts.<br \/>\nIn case if you have missed reading, go through <a title=\"Top 10 Most Illustrated Web Designs\" href=\"https:\/\/weblizar.com\/top-10-illustrated-web-designs\" target=\"_blank\" rel=\"bookmark noopener\">Top 10 Most Illustrated Web Designs<\/a>\u00a0or\u00a0<a title=\"Top 10 Ways To Get More Views On YouTube Videos\" href=\"https:\/\/weblizar.com\/top-10-ways-get-more-views-on-youtube-videos\" target=\"_blank\" rel=\"bookmark noopener\">Top 10 Ways To Get More Views On YouTube Videos<\/a>.<a title=\"Most Common Web Design Mistakes \u2013 Coffin For A Website\" href=\"https:\/\/weblizar.com\/common-web-design-mistakes-coffin-website\" target=\"_blank\" rel=\"bookmark noopener\">Most Common Web Design Mistakes \u2013 Coffin For A Website<\/a>\u00a0is a monstrous dream for any web designer.<\/div>\n<style>\n.single-detail-box{border: 4px solid #1a4562;padding: 20px;border-style: dotted;background: azure;margin-top: 20px;font-size: 18px;}<\/style>\n","protected":false},"excerpt":{"rendered":"<p>Do you want to minify files on your WordPress site? Minifying your WordPress CSS and Javascript files can make them load faster and speed up your WordPress site. So, lets see how to minify css and javascript of your website. Why Minify CSS And JavaScript? SEO is an important aspect for any webmaster since good<\/p>\n","protected":false},"author":5,"featured_media":5201,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[176,205],"tags":[479,480,415],"class_list":["post-5196","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-digital-updates","category-seo","tag-css-and-js-minified","tag-minify-css-and-js","tag-wordpress-minimalist-themes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Minify CSS And JavaScript Of Your WordPress Website - Weblizar Blog<\/title>\n<meta name=\"description\" content=\"Minify CSS and Javascript of your website to gain more speed and more traffic since everybody loves things going fast as far as internet is concerned.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Minify CSS And JavaScript Of Your WordPress Website - Weblizar Blog\" \/>\n<meta property=\"og:description\" content=\"Minify CSS and Javascript of your website to gain more speed and more traffic since everybody loves things going fast as far as internet is concerned.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Weblizar Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/weblizarwp\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-27T12:49:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-13T05:18:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/Minify-Your-CSS-And-JS.png?fit=600%2C259&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"259\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Danish Ansari\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@weblizar\" \/>\n<meta name=\"twitter:site\" content=\"@weblizar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Danish Ansari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Minify CSS And JavaScript Of Your WordPress Website - Weblizar Blog","description":"Minify CSS and Javascript of your website to gain more speed and more traffic since everybody loves things going fast as far as internet is concerned.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/","og_locale":"en_US","og_type":"article","og_title":"How To Minify CSS And JavaScript Of Your WordPress Website - Weblizar Blog","og_description":"Minify CSS and Javascript of your website to gain more speed and more traffic since everybody loves things going fast as far as internet is concerned.","og_url":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/","og_site_name":"Weblizar Blog","article_publisher":"http:\/\/www.facebook.com\/weblizarwp","article_published_time":"2017-03-27T12:49:51+00:00","article_modified_time":"2025-08-13T05:18:56+00:00","og_image":[{"width":600,"height":259,"url":"https:\/\/i0.wp.com\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/Minify-Your-CSS-And-JS.png?fit=600%2C259&ssl=1","type":"image\/png"}],"author":"Danish Ansari","twitter_card":"summary_large_image","twitter_creator":"@weblizar","twitter_site":"@weblizar","twitter_misc":{"Written by":"Danish Ansari","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#article","isPartOf":{"@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/"},"author":{"name":"Danish Ansari","@id":"https:\/\/weblizar.com\/blog\/#\/schema\/person\/d317218747ba5e5aa51886062ac0b628"},"headline":"How To Minify CSS And JavaScript Of Your WordPress Website","datePublished":"2017-03-27T12:49:51+00:00","dateModified":"2025-08-13T05:18:56+00:00","mainEntityOfPage":{"@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/"},"wordCount":751,"commentCount":1,"image":{"@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#primaryimage"},"thumbnailUrl":"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/Minify-Your-CSS-And-JS.png","keywords":["css and js minified","minify css and js","wordpress minimalist themes"],"articleSection":["Digital Updates","SEO"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/","url":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/","name":"How To Minify CSS And JavaScript Of Your WordPress Website - Weblizar Blog","isPartOf":{"@id":"https:\/\/weblizar.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#primaryimage"},"image":{"@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#primaryimage"},"thumbnailUrl":"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/Minify-Your-CSS-And-JS.png","datePublished":"2017-03-27T12:49:51+00:00","dateModified":"2025-08-13T05:18:56+00:00","author":{"@id":"https:\/\/weblizar.com\/blog\/#\/schema\/person\/d317218747ba5e5aa51886062ac0b628"},"description":"Minify CSS and Javascript of your website to gain more speed and more traffic since everybody loves things going fast as far as internet is concerned.","breadcrumb":{"@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#primaryimage","url":"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/Minify-Your-CSS-And-JS.png","contentUrl":"https:\/\/weblizar.com\/blog\/wp-content\/uploads\/2017\/03\/Minify-Your-CSS-And-JS.png","width":600,"height":259,"caption":"Minify Your CSS And JS Blog"},{"@type":"BreadcrumbList","@id":"https:\/\/weblizar.com\/blog\/minify-css-javascript-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/weblizar.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Minify CSS And JavaScript Of Your WordPress Website"}]},{"@type":"WebSite","@id":"https:\/\/weblizar.com\/blog\/#website","url":"https:\/\/weblizar.com\/blog\/","name":"Weblizar Blog","description":"Update yourself with all the latest tech news revolving around wordpress all at one place","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/weblizar.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/weblizar.com\/blog\/#\/schema\/person\/d317218747ba5e5aa51886062ac0b628","name":"Danish Ansari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8578053f8112ac6a0c136fbc87a10af48375433622bcb3df612e573bd2513ef6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8578053f8112ac6a0c136fbc87a10af48375433622bcb3df612e573bd2513ef6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8578053f8112ac6a0c136fbc87a10af48375433622bcb3df612e573bd2513ef6?s=96&d=mm&r=g","caption":"Danish Ansari"}}]}},"_links":{"self":[{"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/posts\/5196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/comments?post=5196"}],"version-history":[{"count":0,"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/posts\/5196\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/media\/5201"}],"wp:attachment":[{"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/media?parent=5196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/categories?post=5196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weblizar.com\/blog\/wp-json\/wp\/v2\/tags?post=5196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}