{"id":559,"date":"2019-08-21T06:48:53","date_gmt":"2019-08-21T06:48:53","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/08\/21\/regenerate-css-file-in-pub-static-folder-in-magento-2\/"},"modified":"2025-05-22T16:08:01","modified_gmt":"2025-05-22T10:38:01","slug":"regenerate-css-file-in-pub-static-folder-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/regenerate-css-file-in-pub-static-folder-in-magento-2\/","title":{"rendered":"How to Regenerate CSS File in pub\/static Folder in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Made a CSS change into the files of your theme?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not able to see those changes in the pub\/static folder?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not being rendered on the frontend of the Magento 2 store?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No worries, I got your back here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Read the solution to <i><strong>regenerate CSS file in pub\/static folder in Magento 2<\/strong><\/i>.<i><\/i><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As a store owner, you may want to change the layout or design on the frontend from time to time to keep the content updated according to the latest trend, potential customers&#8217; taste or as your products or services get updated. However, you may have the issue reflecting the changes on the frontend that you implemented from the admin panel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of the reasons may be the failure of generating CSS file in pub\/static folder in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hence, you will have to regenerate CSS file in pub\/static folder in Magento 2 to offer the new or updated content in the storefront to the customers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s how you can do it:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The solution to regenerate CSS file in pub\/static folder in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following commands to re-generate CSS, JS files, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:upgrade<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:static-content:deploy -f for Magento 2.2.x and Magento 2.3.x.If you are using Magento 2.1.x, use&nbsp;php bin\/magento setup:static-content:deploy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you&nbsp;face a permission issue,&nbsp;give 777 permission to pub\/static generated var folders for Magento 2.2.x and Magento 2.3.x.For Magento 2.1.x,&nbsp;give permission 777 to var\/view_preprocessed var\/cache var\/page_cache var\/tmp var\/generation pub\/static<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> You have to specify locale in php bin\/magento setup:static-content:deploy.<br>e.g php bin\/magento setup:static-content:deploy -f hi_IN for Hindi (India)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That was all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to share the solution on social media with fellow developers  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Also Read:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a title=\"How to Enable Merge CSS, Javascript in Magento 2\" href=\"https:\/\/meetanshi.com\/blog\/enable-merge-css-javascript-in-magento-2\/\" target=\"_blank\" rel=\"noopener\">How to Enable Merge CSS, Javascript in Magento 2<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Made a CSS change into the files of your theme? Not able to see those changes in the pub\/static folder? Not being rendered on the&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-559","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=559"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":15303,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/559\/revisions\/15303"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}