The Ideal Perfmatters Settings: How To Setup Kinsta’s Plugin For Faster Loads While Selectively Disabling Scripts On Pages + Posts

Perfmatters-Settings

Not using Perfmatters yet?

It’s a great plugin by Kinsta and one of the few speed plugins I use on my site. This tutorial shows you what it does and how to configure the best Perfmatters settings (while using the script manager to selectively disable plugins, scripts, and styles for better load times + scores).

Perfmatters does a lot: bloat removal, browser resource hints, hosting analytics locally, WooCommerce optimizations, improved security, delaying JavaScript, serving images from your CDN, and selectively disabling plugins. It should result in a much cleaner, faster website.

What about Asset Cleanup Pro?

Asset Cleanup Pro is very similar, but Perfmatters has a more user-friendly UI and seems to be more lightweight with great documentation. In this Facebook poll, Perfmatters is also favored.

The ideal Perfmatters settings (click thumbnails to enlarge):

Note: Some Perfmatters settings overlap with your cache plugin (for example, WP Rocket already takes care of lazy loading, database cleanup, preloading links/fonts, DNS prefetch, hosting Google Analytics locally, and deferring JavaScript). Disable these in Permatters if you’re already using a separate plugin for these optimizations.

*Before configuring Perfmatters, buy the plugin, grab your license key, and add it in the ‘License’ section. Using my affiliate link is appreciated and helps me write these guides.

 

1. Options

General

  • Disable Emojisenable (emojis hurt load times).
  • Disable Embedsenable (loads pretty previews of URLs from Tweets, YouTube videos, and other URLs while editing, but also loads a JavaScript file on every page on your site).
  • Remove Query Stringsenable (removes URLs with ? or & from static resources which CDNs can have trouble caching, can make small difference, Kinsta says it can only help).
  • Disable XML-RPCenable (unless you post from mobile, otherwise it weakens security).
  • Hide WP Versionenable (prevents your WP version from showing publicly).
  • Disable Password Strength Meterenable (sometimes this file can load across your entire website when it should only load on account, checkout, and password reset pages).

Perfmatters-General-Settings

Lazy Loading

  • Images
  • YouTube Preview Thumbnails
  • Exclude from Lazy Loading – leave blank unless you have file to exclude from lazy loading.
  • DOM Monitoringonly enable if you use infinite scrolling). Kinsta says this “watches for changes in the DOM and dynamically lazy loads newly added elements. This improves compatibility for third-party plugins and themes that utilize infinite scrolling…”

Perfmatters-Lazy-Loading

WooCommerce

  • Disable Cart Fragmentation (cart fragments are used to update the cart total without refreshing a page, but really slow down WooCommerce sites. I suggest checking how long cart fragments take to load in your GTmetrix Waterfall report and make a decision on whether you want cart fragments or faster load times).
  • Disable Status Meta Box

Perfmatters-WooCommerce-Settings

 

2. CDN

  • Enable CDN Rewriteenable (rewrites URLs to serve assets, like images, from the CDN: https://onlinemediamasters.com/wp-content/webpc-passthru.php?src=https://x7r6b9v3.rocketcdn.me//wp-content/uploads/2020/03/logo.png&nocache=1 – Cloudflare doesn’t use a CDN URL so if you’re using it, you would skip the CDN section all together).

Perfmatters-CDN-Settings

 

3. Google Analytics

  • Tracking Code Positionheader (default) is fine.
  • Track Logged In Admins(you don’t want admin visits in your analytics data).
  • Adjusted Bounce Rate30 seconds (recommended by the Perfmatters developers).

Perfmatters-Google-Analytics-Settings

 

4. Extras

General

Perfmatters-General

Assets

  • Script Managerenable (lets you disable CSS + JS on certain pages/posts). See #6.
  • Defer JavaScriptdisable (can fix “eliminate render-blocking resources” in speed tests, but chances are you already have this enabled in your cache plugin, otherwise enable it).
  • Include jQuerydisable (unless you enable previous option and see visible errors).
  • Exclude From Deferralleave blank unless JavaScript files cause errors when being deferred, in which case you would add them here to prevent them from being deferred.
  • Delay JavaScriptgreat for reducing load of third party scripts and comments. For example, I shaved multiple seconds off my blog’s load time by delaying loading the comments section (discuz and gravatars). You can also do this with AdSense and third party scripts. Both WP Rocket / Flying Scripts also let you delay loading JavaScript files.

Perfmatters-Assets

Preloading

*I recommend reading up on browser resource hints to learn what each setting does. You should also be measuring load times of your font, images, and CSS files (e.g. in GTmetrix Waterfall) while making these tweaks to see how each optimization impacts their load time.

  • Enable Instant Pagedisable (same setting as “preload links” in WP Rocket, this downloads a page when users hover over a link. If not using it in WP Rocket, enable it).
  • Preloadfonts, images, and CSS files can be preloaded when used across your entire site. If you look at WP Rocket’s source code, you can see they preload multiples types of these files. Look at your GTmetrix Waterfall tab, test which files load across your entire site, then add them here. WP Rocket already has a “Preload Fonts” option so make sure you only preload them in one place. All preloaded files should be hosted on your domain/CDN.
  • PreconnectCDN URLs and external fonts are the most common examples of preconnecting. Again, grab those files from your GTmetrix Waterfall and add them here.
  • Prefetchthird party scripts are the most common type of prefetching (Google Fonts, Analytics, AdSense, Tag Manager, YouTube, Facebook Pixel). See the reduce DNS lookups section of your GTmetrix report to see which third party scripts are loaded (here’s a nifty list) then add them here. WP Rocket already has this too, so only add them in one place.

Perfmatters-Preloading-Settings

Database

  • Cleans your database (usually not done by your cache plugin, however I always recommend WP-Optimize for advanced cleaning since it lets you delete the same garbage files from Perfmatters, but also lets you delete tables left behind by uninstalled plugins).

Perfmatters-Database-Settings

Tools

Basic uninstall, import, and export settings.

Perfmatters-Tools

 

5. License

Activate your Perfmatters License key here.

Perfmatters-License

 

6. Script Manager

The Perfmatters script manager lets you disable plugins, scripts, and styles on pages/posts where they’re not being loaded. Some things load across your entire website even when they’re not being used. A few examples can include contact forms, social sharing plugins, rich snippet and structured content plugins, or even certain parts of Elementor and other page builders.

Things To Keep In Mind

  • Testing – disabling certain functions, especially in page builders like Elementor, can break things on your site. Do thorough testing if you’re not 100% sure what you’re disabling.
  • Finding Your Slowest Plugins – use Query Monitor or New Relic.
  • Finding Scripts On Different Pages/Posts – edit several pages/posts where different types of scripts are being loaded (and look at your “Global View”) so you don’t miss any.

Step 1 – Enable The Script Manager In The Perfmatters Settings

Perfmatters-Script-Manager-Toggle

Step 2 – Click The Script Manager On A Page Or Post

Script Manager Tab

Step 3 – Disable Unused Scripts From The Page/Post

You can disable the script everywhere (with exceptions), only on the current, and use RegEx to selectively load scripts based on URL patterns. For example, if you have a blog section named /review/post-name you can choose to only load your rich snippets plugin in that category. Same thing with social sharing plugins, affiliate link plugins, table plugins, contact form plugins, etc.

You can disable comments everywhere but posts:

Perfmatters-Script-Manager

Disable Elementor animations and other page builder features you’re not using:

Disable-Elementor-Scripts

Disable certain plugins everywhere except URLs using that plugin:

Ninja-Tables-Disabling

Or use RegEx to only load a plugin on specific URLs. In this example, I disabled a rich snippets plugin everywhere except on URLs containing the word “review” which is the only time I use review schema. You can also enable a plugin everywhere except on URLs with specific words.

Perfmatters Regex Disable

Step 4 – Review Your Global View

The Global View shows you an overview of the script manager across your site.

Script-Manager-Global-View

 

What Do You Think? Is Permatters Worth It?

I think so.

Besides a cache plugin, Perfmatters is really the only other must have speed plugin. What do you think? Some people say they don’t need it and that it only adds more bloat, but I don’t think those people took the time to set it up properly. Let me know what you think in the comments!

Asset-Cleanup-vs-Perfmatters

Cheers,
Tom

About Tom Dupuis

Tom Dupuis 2017Tom Dupuis writes WordPress speed and SEO tutorials out of his apartment in Denver, Colorado. In his spare time, he plays Rocket League and watches murder documentaries. Read his bio to learn 50 random and disturbing things about him.

Subscribe
Notify of
guest
3 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments