How to Set Up Autoptimize for Your WordPress Site


Autoptimize is a unfastened WordPress optimization plugin. In addition to HTML, CSS, and JavaScript optimization, Autoptimize additionally entails optimization options centered at different facets of contemporary WordPress websites.

In this put up, we’ll proportion the most productive Autoptimize plugin settings to toughen the functionality and web page pace of your WordPress website online.

Why Autoptimize?

Before we dive into the most productive Autoptimize settings, let’s briefly pass over 3 the reason why Autoptimize is a brilliant optimization plugin.

    1. The unfastened model of Autoptimize has a whole function set for optimizing your WordPress website online.
  1. Autoptimize is precisely an optimization plugin and does no longer do any HTML web page caching. This manner it’s suitable with all internet hosts – even ones with customized web page caching configurations like Kinsta.
  2. Autoptimize has over 1 million energetic installs within the WordPress repository and is constantly up to date with new options and insect fixes.

Autoptimize JS, CSS, and HTML Settings

HTML, CSS, and JavaScript is Autoptimize’s bread and butter. As with different optimization plugins, digging into Autoptimize’s intensive function set and settings is usually a daunting job. To make issues more straightforward, we’ve compiled the most productive Autoptimize settings for making improvements to your website online’s functionality.

JavaScript Options

JavaScript optimization in Autoptimize.

JavaScript optimization in Autoptimize.

Optimize JavaScript Code

We counsel enabling this selection. When “optimize JavaScript code” is enabled, Autoptimize will minify your JavaScript information.

Aggregate JS Files

Autoptimize’s “combination JS information” possibility will mix your entire JavaScript information right into a unmarried document. In the previous, combining JS and CSS information was once a key step in WordPress optimization. At Kinsta, we use trendy HTTP/2 servers that improve parallel downloads and multiplexing – this implies combining information is not as vital because it used to be as a result of HTTP/2 permits a couple of information to be downloaded on the similar time. With that stated, aggregating CSS and JS information will nonetheless lead to a pace bump for sure varieties of WordPress websites, so we suggest checking out your web page pace with this selection enabled and disabled.

Also Aggregate Inline JS

The “additionally combination inline JS” possibility extracts inline JS to your HTML, and combines it with Autoptimize’s optimized JS document. Since this selection may cause a fast build up in Autoptimize’s cache measurement, we suggest holding this selection disabled except you might have a particular explanation why to allow it.

Force JavaScript in

In maximum instances, we don’t counsel forcing JavaScript information to load to your website online’s HTML part. Forcing JS to load early may end up in render-blocking parts that can decelerate your web page pace. If you might have JavaScript information that want to be loaded within the part, we suggest with the exception of the ones scripts from Autoptimize.

Exclude Scripts from Autoptimize

This possibility permits you to exclude explicit directories and JavaScript information from aggregation. By default, Autoptimize excludes the next scripts.

  • wp-includes/js/dist/
  • wp-includes/js/tinymce/
  • js/jquery/jquery.js

Note that including a script to be excluded simplest impacts aggregation by way of default. Excluded JavaScript information will nonetheless be minified except “minify excluded CSS and JS information” is unchecked underneath  “Misc Options”.

Add Try-Catch Wrapping

Enabling the “upload try-catch wrapping” possibility will wrap your JavaScript code in try-catch blocks. This possibility turns out to be useful for debugging problems led to by way of JS minification and aggregation. If your website online simplest works with “upload try-catch wrapping” enabled, we suggest operating with a developer to undergo your JavaScript information to determine the only inflicting the problem as a result of over the top use of try-catch blocks can scale back JS functionality.

Autoptimize: the unfastened WordPress optimization plugin you did not know you wanted…however that may make your website online lightning rapid ⚡️This information explains precisely why you want it 🚀

Click to Tweet

CSS Options

Autoptimize CSS optimization.

Autoptimize CSS optimization.

Optimize CSS Code

We counsel enabling this selection. When “optimize JavaScript code” is enabled, Autoptimize will minify your JavaScript information.

Aggregate CSS Files

Autoptimize’s “combination CSS information” possibility will mix your entire CSS information right into a unmarried document. As we discussed previous, this selection won’t receive advantages websites that improve HTTP/2. We counsel A/B checking out this selection for your website online to decide if there may be any certain affect on web page pace.

Also Aggregate Inline CSS

This possibility will transfer inline CSS to Autoptimize’s CSS document. While transferring inline CSS to a browser-cacheable CSS document can scale back web page measurement, we suggest leaving this selection disabled normally.

Generate Data: URIs for Images

When this selection is enabled, Autoptimize will base64-encode small background pictures and embed them into CSS. We counsel checking out out this selection to gauge the affect for your web page pace. While encoding pictures into base64 structure reduces the choice of HTTP requests, base64 representations information are usually 20-30% greater than their binary opposite numbers.

Inline and Defer CSS

Inlining severe CSS may end up in an important pace spice up for some websites. The thought this is inline kinds which might be required for parts which might be “above the fold”. In apply, inline CSS in most cases objectives parts like structural parts, international font households and sizes, and navigation styling.

By inlining those key parts, the bigger entire CSS document may also be loaded at a later time with out impacting the glance of the web page. While it’s conceivable to manually extract severe kinds, we suggest the use of a device like this one to generate the kinds as a place to begin.

Generate critical CSS.

Generate severe CSS.

After producing the severe CSS, reproduction and paste it into Autoptimize settings.

Inline and defer CSS in Autoptimize.

Inline and defer CSS in Autoptimize.

The subsequent step is to check your website online’s frontend enjoy. If you realize some bizarre flashes of unstyled content material (FOUC), you’ll most probably want to determine the ones unstyled parts and upload the corresponding kinds into Autoptimize for inlining.

Autoptimize gives a “power-up” that routinely generates severe CSS for your WordPress pages. From our enjoy, this selection can every now and then decelerate your website online as it makes use of exterior API calls to generate the severe CSS. Thus, the preliminary severe CSS technology depends at the responsiveness of an exterior server. In maximum instances, the aforementioned way which doesn’t require any exterior API calls is a cleaner answer.

Inline all CSS

For maximum websites, we don’t counsel inlining all CSS as it might build up web page measurement dramatically. Furthermore, inlining all CSS makes it unattainable for the internet browser to cache CSS.

Exclude CSS from Autoptimize

By default, Autoptimize excludes the next directories and CSS information from aggregation. If you prefer to to save you Autoptimize from aggregating any of your CSS information, you’ll be able to upload them to this record. Similar to JavaScript exclusion, this selection’s default habits does no longer save you CSS information from being minified – simplest aggregated.

  • wp-content/cache/
  • wp-content/uploads/
  • admin-bar.min.css
  • dashicons.min.css

HTML Options

Autoptimize’s HTML optimization can lend a hand scale back the scale of your pages by way of disposing of whitespace.

HTML optimization in Autoptimize.

HTML optimization in Autoptimize.

Optimize HTML Code

We counsel enabling the “optimize HTML” code function as it reduces web page measurement by way of disposing of pointless whitespace to your HTML. While this selection is suitable with maximum websites, disposing of whitespace may cause system faults on some websites. Thus, we suggest checking out HTML code optimization totally earlier than the use of it in a manufacturing atmosphere.

Keep HTML Comments

Enable this selection if you want to stay HTML feedback for your optimized pages.

CDN Options

If you might be the use of a CDN like KinstaCDN to boost up static belongings, you’ll want to upload the CDN URL to Autoptimize. If you might be the use of a proxy provider with CDN functions like Cloudflare, you don’t want to configure the rest in Autoptimize’s CDN choices.

Configure CDN settings in Autoptimize.

Configure CDN settings in Autoptimize.

Cache Info

Autoptimize’s “cache data” presentations vital knowledge like the site and permissions of the cache folder, in addition to the overall measurement of the cached kinds and scripts. If you notice “No” subsequent to “Can we write?”, you’ll want to paintings along with your host to repair the folder permissions.

Autoptimize cache info.

Autoptimize cache data.

Misc Options

Autoptimize has a couple of miscellaneous optimization settings. If you’re having problems getting optimized CSS and JS information to load for your website online, you might want to reconfigure one of the most settings underneath.

Miscellaneous optimizations in Autoptimize.

Miscellaneous optimizations in Autoptimize.

Save Aggregated Scripts/CSS as Static Files

We counsel enabling this selection to save aggregated information as static information in the neighborhood. You might want to disable this in case your server isn’t configured to care for document compression and expiry.

Minify Excluded CSS and JS Files

We counsel enabling this selection to ensure that all CSS and JS information are minified. However, should you realize some minification-related problems with a few of your excluded CSS and JS information, you’ll be able to pass forward and disable this selection.

Also Optimize for Logged In Editors/Administrators

We counsel enabling this to ensure that belongings are optimized for logged-in editors and directors. This is vital in case you are checking out Autoptimize settings as a logged-in person.

Image Optimization in Autoptimize

Autoptimize includes a integrated integration with ShortPixel for optimizing pictures. In addition to a picture high quality surroundings, Autoptimize’s integration additionally permits you to generate and serve WEBP variations of your pictures.

For Kinsta customers, we don’t counsel the use of the picture optimization function in Autoptimize. Instead, we suggest the use of the full-featured plugins from ShortPixel or Imagify at once. With the complete plugin, you’ll have extra granular regulate over optimization settings together with rewriting pictures to use the tag, which is needed for WEBP improve on Kinsta.

Lazy-load images with Autoptimize.

Lazy-load pictures with Autoptimize.

Autoptimize additionally entails lazy-loading capability for pictures. We counsel enabling this selection to toughen web page pace for image-heavy pages. When lazy-loading is enabled, Autoptimize means that you can exclude sure picture categories and filenames from being lazy-loaded.

The exclusion surroundings turns out to be useful for pictures like emblems, social icons, and different vital picture parts that shouldn’t be lazy-loaded. If you’re taking a look for an answer that gives extra regulate over lazy-loading, take a look at our information on lazy-loading pictures and movies in WordPress.

Extra Optimizations in Autoptimize

Extra optimizations in Autoptimize.

Extra optimizations in Autoptimize.

Google Fonts

Autoptimize has a couple of other choices for optimizing Google Fonts. The most suitable choice for you’ll rely on how your website online makes use of Google Fonts.

  • Leave as is.
  • Remove Google Fonts.
  • Combine and hyperlink in head.
  • Combine and preload in head.
  • Combine and cargo fonts asynchronously with webfont.js.

We don’t counsel the use of the “depart as is” possibility as it gives no pace receive advantages.

If Google Fonts isn’t a mission-critical requirement for your website online, disposing of them and the use of a gadget font stack as a substitute could have an enormous certain affect for your web page pace.

If you prefer to to stay Google Fonts for your website online, we suggest checking out out the final 3 choices to in finding out which one works easiest for your website online.

Remove Emojis

This Autoptimize possibility eliminates CSS and JavaScript connected to WordPress core emojis. We counsel enabling this selection as a result of it might lend a hand narrow down your web page measurement. Furthermore, maximum mainstream running methods send with font stacks that come with emojis. Of route, there are alternative ways as neatly to disable emojis for your WordPress website online.

Remove Query Strings from Static Resources

If you’d like to take away question strings (e.g. ?ver=) from static assets, you’ll be able to allow this selection. The elimination of question strings is not going to affect load time, however it’s going to lend a hand toughen your website online’s ranking in GTmetrix, Google Pagespeed, and different functionality checking out products and services.

Preconnect to third Party Domains

The preconnect directive permits your browser to attach to specified domain names to procedure DNS lookups and SSL handshake negotiations earlier than a complete HTTP request is shipped.

For instance, in case your website online has an emblem picture that’s served from https://website, you’ll be able to instruct Autoptimize to upload a preconnect directive to care for the preliminary DNS and SSL connections within the part earlier than the HTTP request is made within the part of your HTML.

You can use your browser’s developer equipment or inspector to in finding vital exterior domain names to preconnect to. In the instance web page underneath, there are exterior requests to the next domain names.


These 3 domain names may also be added to Autoptimize’s preconnect record.

Find external assets with developer tools.

Find exterior belongings with developer equipment.

For functionality causes, we suggest including not more than six domain names to Autoptimize’s preconnect record as a result of specifying preconnect directives for too many domain names may end up in a functionality hit.

Preload Specific Requests

Preload directives instruct your internet browser to obtain an asset once conceivable. This directive turns out to be useful for downloading belongings which might be wanted very early within the web page load procedure. In apply, preloading is continuously used to accelerate load occasions for customized fonts by way of loading them earlier than they’re asked within the web page’s CSS.

We counsel consulting with a developer relating to which belongings, if any, to preload for your WordPress website online. As with many different performance-related tweaks, preloading too many belongings may cause your website online to load slower.

Async JavaScript Files

Autoptimize’s “async JavaScript information” function permits you to specify sure exterior JavaScript information to load asynchronously by means of the async HTML flag. While loading JS information asynchronously can toughen web page pace, we suggest doing good enough checking out to make certain that no website online capability is affected.

If you are no longer already the use of Autoptimize, you can need to upload this WordPress optimization plugin to your website online ASAP after studying this information 🚀

Click to Tweet


If you know the way to tweak its settings, the Autoptimize plugin is a forged possibility for WordPress customers taking a look to spice up website online functionality.

With fundamental options like HTML and CSS optimization and extra complex ones, like CDN integration and the power to specify preconnect and preload directives, Autoptimize has the whole thing you want to optimize your WordPress website online’s frontend functionality.

If you’re eager about finding out extra about WordPress optimization and the way to optimize your website online’s backend, be sure that to take a look at our complete WordPress functionality information.

If you loved this text, then you definitely’ll love Kinsta’s WordPress internet hosting platform. Turbocharge your site and get 24/7 improve from our veteran WordPress crew. Our Google Cloud powered infrastructure makes a speciality of auto-scaling, functionality, and safety. Let us display you the Kinsta distinction! Check out our plans


Recent Articles

How To Set Different Wallpapers On Multiple Screens On MAC

Does this question pop in your head when you think of setting up multiple screens on MAC? If so, the next few...

5 Must-Have Android Apps for 2020

The digitization of most of the amenities of society was a breakaway from the traditional livelihood of the masses.

How To Rearrange Comments in WordPress

Rearranging feedback to show the newest one on most sensible is changing into a brand new development that an increasing number of most sensible...

How to Highlight Author’s Comments in WordPress

On maximum websites, it is rather arduous for customers to observe creator’s feedback. This is why many WordPress websites spotlight their creator’s remark by...

How to Add Categories and Subcategories to WordPress

WordPress comes with the facility to kind your content material into classes, tags, and taxonomies. One of the most important distinction between classes and...

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here