Unify CSS and JavaScript in WordPress

Last Revised: October 2, 2021

In general, style files (CSS) and scripting files (JavaScript) include certain information such as versions, either in their name, inside, in some comments … the fact of unifying, reducing and cleaning them allows that internally the data remains active (necessary for the proper functioning of WordPress) but invisible to users.

There are several reduction systems, usually in the form of a plugin, and that basically have to allow 3 options: clean, reduce and unify CSS, clean, reduce and unify JavaScript and clean, reduce and unify the HTML.

WordPress itself has a similar way that is the concatenation and compression of elements. To do this, the following elements should be included in the configuration file [wp-config.php]:

define('CONCATENATE_SCRIPTS', true);
define('COMPRESS_CSS', true);
define('COMPRESS_SCRIPTS', true);

This system complicates automatic detection, but does not reduce the risk completely.


Seguir con Seguridad para WordPress


About this document

This document is regulated by the EUPL v1.2 license, published in WP SysAdmin and created by Javier Casares. Please, if you use this content in your website, your presentation or any material you distribute, remember to mention this site or its author, and having to put the material you create under EUPL license.