How To Setup Perfmatters Settings (With Script Manager)

How To Setup Perfmatters Settings (With Script Manager)

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.

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 Emojis – enable (emojis hurt load times).
  • Disable Embeds – enable (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 Strings – enable (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-RPC – enable (unless you post from mobile, otherwise it weakens security).
  • Remove jQuery Migrate – disable (enable this setting if you’re not using a page builder).
  • Hide WP Version – enable (prevents your WP version from showing publicly).
  • Remove wlwmanifest Link – enable (you probably don’t use Windows Live Writer).
  • Remove RSD Link – enable (if you edit your site using a browser instead of blog clients).
  • Remove Shortlink – enable (especially if you already use shortened, pretty permalinks).
  • Disable RSS Feeds – disable (only enable if you don’t have a blog).
  • Remove RSS Feed Links – enable (removes unnecessary links in your RRS feed to pages, posts, comments, categories, tags, etc. This will remove a little unused code on your site).
  • Disable Self Pingbacks – enable (disables pingbacks when linking to your own blog).
  • Disable REST API – disable for non-admins (otherwise, the REST API will leave usernames of anyone who has published on your WordPress site accessible via URLs).
  • Remove REST API Links – enable (removes a short line of code created by the REST API).
  • Disable Dashicons – disable (unless you want to remove the icons from WP admin bar).
  • Disable Google Maps – enable (removes Google Maps on your entire site which some plugins/themes have the API built-in). If you want to use Google Maps, keep this setting disabled and embed Google Maps manually on necessary pages like contact + local pages).
  • Disable Google Fonts – disable (however, this should ideally be enabled since hosting fonts locally and system fonts load much faster without creating external requests, can also be used to disable your theme’s Google Fonts or use a premium custom Google Font).
  • Disable Password Strength Meter – enable (sometimes this file can load across your entire website when it should only load on account, checkout, and password reset pages).
  • Disable Comments – disable (unless you want to disable blog comments completely).
  • Remove Comment URLs – enable (disables comment author links which are often spam).
  • Disable Heartbeat – disable everywhere (only enable if you need the Heartbeat API which shows you when other uses are editing a post, real-time plugin notifications, etc).
  • Heartbeat Frequency – 60s (doesn’t matter if previous option is disabled everywhere).
  • Limit Post Revisions – 5 (gives you a few backups of old posts in case you need to restore a post to an earlier version, but prevents too many revisions from bloating your database).
  • Autosave Interval – 5 minutes (same concept as previous option, WordPress will autosave a post every 5 minutes but not frequent enough to consume lots of resources).
  • Change Login URL – enter a custom WordPress login URL to prevent the wp-admin and wp-login URLs from being accessed directly (can improve security and block spam bots).

Perfmatters-General-Settings

Lazy Loading

  • Images – disable (only enable if you’re not lazy loading images elsewhere).
  • iFrames and Videos – disable (only enable if you’re not doing this elsewhere).
  • YouTube Preview Thumbnails – disable (only enable if you’re not doing this elsewhere. This replaces the YouTube iframe with preview a image so the iframe is only loaded once someone clicks the “play” button. This can easily cut your video’s load times in half).
  • Exclude from Lazy Loading – leave blank unless you have file to exclude from lazy loading.
  • DOM Monitoring – disable (only 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 Scripts – enable (disables WooCommcere scripts/styles except on product, cart, checkout pages. Otherwise, these load across your site even on pages without products). 
  • Disable Cart Fragmentation – enable for faster load times (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 – enable (disables the widget in your dashboard showing sales, orders, and stock options which most people don’t use as they often use better analytics).
  • Disable Widgets – enable (disables WooCommerce widgets which are often not used).

Perfmatters-WooCommerce-Settings

 

2. CDN

  • Enable CDN Rewrite – enable (rewrites URLs to serve assets, like images, from the CDN: https://x7r6b9v3.rocketcdn.me//wp-content/uploads/2020/03/logo.png – Cloudflare doesn’t use a CDN URL so if you’re using it, you would skip the CDN section all together).
  • CDN URL – enter your CDN URL from RocketCDN (WP Rocket) or another CDN like StackPath or KeyCDN (not Cloudflare). This allows the CDN Rewrite setting to work.
  • Included Directories – usually nothing to do here (Perfmatters automatically includes wp-content and wp-includes in the CDN rewriting, which should be all most sites need).
  • CDN Exclusions – add .xml if you use an SEO plugin like Yoast (recommended by the Perfmatters developers). These are directories + file extensions excluded from the CDN.

Perfmatters-CDN-Settings

 

3. Google Analytics

  • Enable Local Analytics – enable (allows you to  host Google Analytics locally which should fix the “leverage browser caching” issue for Google Analytics in some speed testing tools).
  • Tracking ID – enter your Google Analytics tracking ID.
  • Tracking Code Position – header (default) is fine.
  • Script Type – analytics.js or minimal are recommended (each type of Google Analytics script has a difference file size and lets you do different things inside GA as shown here). These two script types still give you enough GA data and also have a very small file size.
  • Disable Display Features – enable (disables remarketing and advertising options in GA which creates a 2nd HTTP request to DoubleClick, but usually not used by most people).
  • Anonymize IP – enable (hides your IP to comply with GDPR/privacy in some countries).
  • Track Logged In Admins – disable (you don’t want admin visits in your analytics data).
  • Adjusted Bounce Rate – 30 seconds (recommended by the Perfmatters developers).
  • Use MonsterInsights – disable (unless you’re using the MonsterInsights plugin in which case you should enable this to host Google Analytics locally when using MonsterInsights).

Perfmatters-Google-Analytics-Settings

 

General

  • Add Blank Favicon – disable (this setting is mainly used for measuring speeds of fresh WordPress installs, it removes favicons are sometimes a large image in default themes).
  • Add Header Code – leave blank (unless you want to add code to your header).
  • Add Body Code – leave blank (unless you want to add code to your body).
  • Add Footer Code – leave blank (unless you want to add code to your footer).

Perfmatters-General

Assets

  • Script Manager – enable (lets you disable CSS + JS on certain pages/posts). See #6.
  • Defer JavaScript – disable (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 jQuery – disable (unless you enable previous option and see visible errors).
  • Exclude From Deferral – leave blank unless JavaScript files cause errors when being deferred, in which case you would add them here to prevent them from being deferred.
  • Delay JavaScript – great 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 Page – disable (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).
  • Preload – fonts, 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.
  • Preconnect – CDN URLs and external fonts are the most common examples of preconnecting. Again, grab those files from your GTmetrix Waterfall and add them here.
  • Prefetch – third 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

Keep reading the article at Tom Dupuis. The article was originally written by Tom Dupuis on 2020-12-16 02:56:30.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Your ❤️ Love! Like Us
Scroll to Top