How to decompress compressed css code

How to compress your CSS, HTML and Javascript files

Divi: the easiest WordPress theme to use

Divi: the best WordPress theme ever!

More 901,000 downloads, Divi is the world's most popular WordPress theme. It's complete, easy to use, and comes with 62+ free templates. [Recommended]

Compressing your website's CSS, HTML, and Javascript files can save you valuable time loading your website's page. Now it's not about halving the speed of page loading or anything, but when it comes to the speed of your website, a little counts.

The loading speed of your website is important not only for new visitors but also for search engine rankings.

The termminifyThe programming language describes the process of removing unnecessary characters from the source code. These characters include spaces, line breaks, the comments and block separators that are useful to us humans but useless to machines.

We minimize a website's files that contain CSS, HTML, and Javascript code so your web browser can read them faster.

Also read our article about 10 WordPress plugins to improve the speed of your blog

Here is an example of CSS minification.

CSS before minification

/ * A sample CSS file ---------------------------------- * / .user-profile-card {margin: 0px; Background: # 33E43} .user-profile-description {border: 0; Position: absolute; Width: car; Top margin: 20px; }

CSS after minimizing

.user-profile-card {margin: 0; background: # 33e43} .user-profile-description {border: 0; position: absolute; width: auto; margin-top: 20px}

Of course, this is just a small example of using a CSS snippet, but you can imagine how much space would be saved shrinking thousands of lines of code.

How can you increase the time on your WordPress blog?Find out by consulting this article.

So, if you want to do this manually, you can technically do it. However, you have a high risk of errors and waste your valuable time unnecessarily!

Follow these tips and use the tools that are available to you.

Some tools to do the compression

Fortunately, you don't necessarily have to be a developer or know any of the programming languages ​​to reduce the file size of your website. Minimization has become a common practice in the world of web design. So you shouldn't be surprised to learn that there are many wonderful (and free) tools to get your job done.

See also ours 6 WordPress plugins to breathe new life into your articles

Here is a list of useful tools to get you started. Since many of these can minimize multiple code types, I've enclosed the code type options in parentheses.

    • cssminifier.com etjavascript-minifier.com (CSS and JS) - These two mini drivers from Andrew Chilton are easy to use. All you have to do is paste your code and then hit the button Zoom out to view the compressed code. You can even conveniently download the exit code as a file.
    • htmlcompressor.com (HTML, CSS, and JS) - This online compression / collapse tool supports HTML, CSS, and JS code types. It even supports different combinations of code types like CSS + PHP and JavaScript + PHP. You can even check the compressed code for errors.
    • csscompressor.net (CSS only) - This online CSS compressor is quick, easy, and free to use.
    • jscompress.com (JS only) - This JavaScript compression tool allows you to compress JavaScript code by copying and pasting it. However, you can also download multiple JavaScript files at the same time. This is ideal for combining JavaScript files into a single file to improve page loading speed.
    • Dans tools -Dan's tools propose unMinimize CSS andMinimize JavaScript . Both tools have a really clean, easy to use interface. They don't offer advanced options, but they are great for general minimization purposes.
    • refresh-sf.com (HTML, CSS and JS) - This compressor reduces JavaScript, CSS and HTML code types. It also includes all of the compression options for each type of code if required.
    • Closure Compiler (JS only) - Closure Compiler is part ofClosure tools , a set of tools from Google Developers. You can minimize your JavaScript with other useful tweaks. You can use your javascript code by entering the url of the location of the js file and then choosing how the code should be optimized and formatted.

For example, you tweak your code to just remove the spaces if you want. Once you hit the compile button, the code will be collapsed (or compiled) for you.

    • minifycode.com (HTML, CSS and JS) - This website offers minifiers for JavaScript , CSS etHTML with a simple and clean user interface that compresses your code with a single click. It also provides a "beautification" tool to decompress the minimized code to make it more readable (the opposite of minification).

If you're looking for offline tools to locally minify your CSS or JavaScript HTML, here are a few options:

How to reduce the size of HTML, CSS, and JavaScript using an online tool

Many of these online tools have a similar process that includes the following steps:

  • Paste in your source code or download the source code file.
  • Optimize settings for a specific output (if options are available)
  • Click a button to compress the code.
  • Copy the result of the minimized code or download the file with the minimized code.

In this example I am using the Minify tools from minifycode.com.

See also:How to safely add a CSS code to Wordpressby consulting this link.

First, find the CSS file (commonly known as style.css) in your website files and open it with a page editor. Then copy all of the CSS code to your clipboard.

go to minifycode.com and click the CSS Minifier tab. Then paste the CSS code into the input field and click the button Reduce CSS.

Copy the new minimized code as soon as it is generated.

Easily build your website with Elementor

Elementor makes it easy to create any website design with a professional look. Stop paying dearly for what you can do yourself. [Free]

Then go back to your website's CSS file and replace the code with the new simplified version.

That's it!

Repeat this process to flatten your website's JavaScript and HTML file (s) as well.

Minimizing HTML, CSS and JavaScript in WordPress using plugins

The easiest way to keep HTML, CSS and JavaScript to a minimum in WordPress is to use a plugin. This allows you to automatically optimize your WordPress website files to reduce page load time with just a few button clicks.

There are plenty of plugins out there that do the job, but I'll give you a few examples briefly.

Optimize automatically (FREE)


Autoptimize is probably the most popular Minify WordPress plugin out there. It's popular because it's easy to use and has many powerful features. It can bundle (combine), minimize, and cache your code. As a bonus, you have additional options to optimize Google Fonts, Images, etc.

To use Autoptimize, you can download, install and activate the plug-in from the WordPress dashboard at Plugin> Add New.

For more information, see our guide on: How to install a plugin in Wordpress

Once the plugin is activated, go to Settings> Automatic optimization. Then, on the Main Parameters tab, review the code you want to tweak (HTML, CSS, and / or JavaScript) and click E.save Changes.

You can also click the button Show Advanced Settings at the top of the page to further customize your code optimization.

It's more or less that! Very simple and powerful.

W3 Total Cache (FREE)


W3 Total Cache is an excellent caching plugin that can help you minimize your HTML, JS, and CSS files.

WP fastest cache (FREE)


WP fastest cache - This WordPress caching plugin is very popular with high reviews. It does various performance tweaks including combining and flattening HTML CSS and JavaScript for better performance.

Also read our article about 8 WordPress plugins have a live chat on your blog

Once the plugin is installed, just click the tab WP fastest cache in the WordPress dashboard sidebar. Under the tab Settingsyou will find options for combining and collapsing HTML and CSS files. Minimizing JavaScript is only available in the Pro version.

Don't waste time and money!

Discover the best tool for creating your blog, online store blog or any other website in just a few clicks!

To summarize it

If you want to make your blog faster and more powerful, you need to reduce the size of your HTML, CSS, and JavaScript files. With all the online tools available, you can easily reduce the code of any website.

9 WordPress plugins to hide your blog's contentabsolutely to be discovered

For those who use WordPress, there are powerful plugins available that allow you to automatically minimize these files with just a few clicks.

Also discover some premium WordPress plugins

You can use other WordPress plugins to get a modern look and optimize the grip of your blog or website.

We offer you some premium WordPress plugins here that will help you with this.

1. 404 error page redirects to the homepage or to the custom page

Here is one of the best ways to easily add a 404 error page that will redirect the visitor to the home page or personalized page after activating this plugin. WordPress Premium.

All 404 error pages are redirected to the homepage or toa custom url. With this WordPress plugin, you can allow Google to reduce your website's PageRank when there are a lot of 404 error pages.

also discoverHow to Fix 413 Errors in WordPress

This WordPress plugin not only redirects, but can also be a suitable solution to improve the ranking of your website in the search engine results.

Download | Demo | Web hosting

2. Borlabs cache

WordPress is a platform powered by a database that generates content dynamically. The more content and plugins you have, the more database queries will be executed. This can affect the performance of your website, especially if your database is on a different server.

The WordPress Borlabs Cache plugin saves dynamically generated content as a static file on your server storage. When the page is requested, this static file is loaded and sent to the visitor. This is considerably faster than with normal database queries. But that is not all.

See also ours5 WordPress plugins to clean up your website's database

Your pages contain a lot of unnecessary spaces or HTML comments, which increases the overall page size. Borlabs Cache removes them all and GZIP compresses your pages.

DiscoverLike all your Wordpress publications are displayed on a single page

Many plugins have their own JavaScript and CSS files, which leads to more requests on your server. Borlabs Cache combines all of these JavaScript and CSS files so that, in the best case scenario, your visitor only needs to load a JavaScript file and a CSS file.

DownloadDemo | Web hosting

3. Multilingual press

Multilingual Press works with an installation of WordPress at several locations and enables the linking of translations. The plugin contains 174 languages ​​built into the language manager and supports an unlimited number of websites, so you can create and link as many translations as you want.

This is good for SEO as it allows you to keep your languages ​​on separate posts and pages. If you ever decide to use a translation other than the plugin, your content will remain intact (Even after deactivating or removing the Multilingual Press plug-in). In addition, you can add a translation widget to easily switch between translations.

DiscoverHow to add a code snippet using Gutenberg in WordPress

Multilingual Press is a great free option for adding translations to your WordPress site viaMulti-site. If you ever find that you need more options, you can go for the Pro version, which costs $ 75.

Download demo | Web hosting

Other recommended resources

We also invite you to consult the resources listed below to improve your control and control over your website and blog.

Conclusion

Here is ! Hope you now know how to shrink your CSS, HTML, and JS files.

However, you can also use ours resourcesIf you need more elements to carry out your website creation projects, consult our guide on the WordPress blog creation or the one on Divi: the best WordPress theme ever.

If you have commentaires or suggestions, do not hesitate to let us know in the reserved area. But in the meantime Share this article on your various social networks

... 

This article has 1 comment

This website uses Akismet to reduce unwanted content. Learn more about how your comment data is used.