How to Merge WordPress External CSS Illustrations

See the “merge external CSS” warning in Pingdom, GTmetrix, or Google PageSpeed Insights? This is a very common mistake for many WordPress sites. This warning is usually displayed when you load 10 or more CSS files from CDN and / or subdomains (external domains). One way to solve this problem is to concatenate your CSS files or combine them to load them in a single request.

Note: if you run through HTTPS using a provider that supports HTTP/2, you can usually safely ignore this warning now. With HTTP/2, you can now load multiple CSS files in parallel over a single connection.

How to Merge WordPress External CSS Illustrations1

Pingdom merge external CSS warning

if you are still running through HTTP and have not yet migrated to HTTP/2, you can follow the tutorial below to learn how to merge external CSS files. Similarly, concatenation is now a technology that is generally considered deprecated. More than 77% of browsers now support HTTP/2 when running through HTTPS and many CDN and web hosting providers. When

uses CDN, you usually see merge external CSS warnings because you host the CSS file on an external domain, such as cdn.domain.com. All you can do is connect your CSS file to your Web server. Once they are grouped together, you will no longer see this warning because it will load them in a single request. One of the easiest ways to do this is to use a free WordPress plug-in called Autoptimize developed by Frank Goossens. The

How to Merge WordPress External CSS Illustrations2

Autoptimize plug-in

is a very lightweight plug-in, only 176KB, to be exact. At the time of this writing, it currently has more than 1000000 active installations. The plug-in helps you concatenate scripts, zoom out, add out-of-date headers, and move styles to headers and scripts to footers.

you can download it from the WordPress plug-in library, or you can search for it under the install plug-in plug-in in the WordPress dashboard. After installation, you will need to enter the settings and enable the “Optimize CSS Code” option. This will concatenate (combine) your CSS files. If you are using CDN, be sure to enter your CDN URL. In this way, your CSS file will be loaded on the CDN as a single request.

How to Merge WordPress External CSS Illustrations3

merge external CSS files

after enabling the above settings, you will see a CSS file of the “autoptimize_xxxxx.css” file.

How to Merge WordPress External CSS Illustrations4

combined CSS files

Disclaimer: All articles on this website, unless otherwise specified or marked, are original and published on this website. Any individual or organization is prohibited from copying, stealing, collecting, or publishing the content of this site to any website, book, or other media platform without the consent of this site. If the content on this website infringes on the legitimate rights and interests of the original author, you can contact us for assistance.