In this guide, I’ll show you how to set up the Perfmatters settings.
Affiliate Disclaimer – I use affiliate links to Perfmatters and would really appreciate your support. It helps me write more helpful tutorials like this one. Seriously, thank you!
- Disable Emojis: ON – removes JS file loaded by emojis.
- Disable Dashicons: ON – prevents admin icon font from loading on the frontend.
- Disable Embeds:ON – when you paste a URL into your WordPress editor, this feature loads a pretty preview (from YouTube, Facebook, Tweets, etc). Disable if you don’t use it.
- Disable XML-RPC: ON – bad for speed + security (used to publish content from mobile).
- Remove jQuery Migrate: ON – leave on if you’re using a page builder, disable otherwise.
- Hide WP Version: ON – improves security by hiding WP version from showing publicly.
- Remove wlwmanifest Link: ON – you likely don’t use Windows Live Writer, so disable.
- Remove RSD Link: ON – used to edit your site in a browser instead of blog clients.
- Remove Shortlink: ON – disable if you’re using the “post name” permalink structure.
- Disable RSS Feeds: OFF – only enable this if you don’t have a blog on your website.
- Remove RSS Feed Links: ON – removes unnecessary links in your RSS feed to pages, posts, comments, categories, tags, etc. This will remove a little unused code on your site.
- Disable Self Pingbacks:- ON – disables pingbacks when linking to your own blog.
- Disable REST API: disable for non-admins – hides usernames of anyone who published on your site to improve security, but completely disabling it often leads to errors with Gutenberg and certain plugins. Therefore, disabling Rest API for non-admins is safest.
- Remove REST API Links: ON – removes a short line of code created by the REST API.
- Disable Google Maps: OFF – some themes/plugins have the Google Maps API built-in with no option to disable this, in which case you can disable Maps if you don’t use them.
- Disable Password Strength Meter: ON – removes a file that can sometimes load on your website when it should usually only load on account, checkout, and password reset pages.
- Disable Comments: OFF – you probably don’t want to disable your blog comments.
- Remove Comment URLs: ON – disables comment author links which are often spam.
- Add Blank Favicon: OFF – only used for speed testing purposes on fresh WP installs.
- Remove Global Styles: ON – removes 311 lines of unminified code which seemed to be added by mistake to WordPress core. It was originally added to improve duotone styles.
- Heartbeat: only allow when editing posts/pages – recommended by Perfmatters. This disables Heartbeat unless you’re editing content, then set the Heartbeat Frequency to 60s. This reduces Heartbeat requests and reduces CPU usage, but enables only when needed.
- 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 – increase frequency to reduce CPU and save resources.
- Change Login URL: add a custom login URL – stops unwanted requests by hiding wp-login from bots/attackers. If using QUIC, keep the default URL since it has features to protect it. You can also change the redirect/message when the default login is viewed.
- Script Manager: ON – remove unused CSS/JS on specific pages/posts (see below).
- Delay Behavior: only delay specified scripts – better control of which files are delayed. “Delay all scripts” is more aggressive but may include files loading above the fold and others you may not want delayed. In that case, you would need to exclude those files.
Check the examples in the Perfmatters documentation, but here are common files:
ga( ' ga(' google-analytics.com/analytics.js analytics.js gtagv4.js analytics-minimal.js /gtm.js /gtag/js gtag( /gtm- adsbygoogle.js fbevents.js fbq( /busting/facebook-tracking/ wp-content/themes/script-name wp-content/plugins/plugin-name
Using The Script Manager
Once the script manager is enabled, view any page/post and you’ll see it on top.
In your script manager settings, I recommend enabling display dependencies and test mode which only shows the script manager changes to logged-in admins (since disabling CSS/JS can sometimes break your site). Whenever you’re ready to publish changes, simply toggle this off.
View the scripts/styles loading on the post (they should be categorized by plugins). You can disable them everywhere, on the current URL, use regex (URL patterns), and make exceptions.
- Disable social sharing buttons everywhere but posts.
- Disable contact form plugin everywhere but contact page.
- Disable slider/gallery plugins everywhere but certain URLs.
- Disable extra page builder plugins where they’re not being used.
- Disable email plugins on pages if forms are only used on your blog.
- Disable unused page builder CSS/JS (most have built-in settings for this).
- Remove Unused CSS: ON – Perfmatters and FlyingPress arguably do a better job at removing unused CSS than WP Rocket because they inline critical CSS, then used CSS is loaded in a separate style sheet. Whereas WP Rocket will inline the entire unused CSS (optimizing for scores but not real world browsing). And SiteGround Optimizer doesn’t have this feature. In other words, use either FlyingPress or Perfmatters this. And if you enable it, Perfmatters suggests disabling CSS preloads and uncombine CSS beforehand.
- Used CSS Method: File – file for browsing speed, inline for scores (see above).
- Stylesheet Behavior: Delay – what Perfmatters recommends for better LCP/FCP.
- Clear Unused CSS: use this if you make design/code changes and aren’t seeing them.
Preload, preconnect, prefetch are often recommended in PSI. Many cache plugins automatically preconnect CDN URLs and Google Fonts (and some add preload automatically too). Read up on your cache plugin’s documentation, then use Perfmatters to add more resource hints if needed.
- Enable Instant Page: OFF – downloads pages in the background when users hover over a link. However, this can cause high CPU usage and the benefit might not outweigh the cost.
- Preload: only do this for resources that need to load immediately like above the fold images, fonts, and CSS. Google may show you recommendations under “preload key requests” and “largest contentful pain element,” but you may be able to preload others.
- Preload Critical Images: 2-3 – preloads above the fold images while also excluding them from lazy load. This should be set to the number of images usually shown above the fold (screenshot) which is usually 2-3. Great setting to automate this and improve LCP score.
- Preconnect – CDN URLs and third-party Google Fonts (font.gstatic.com) are usually the only URLs you should preconnect. Your cache plugin may already do this, so make sure you check the documentation. Fonts should always be preconnected using CrossOrigin.
- Prefetch – open your “reduce impact of third-party code report” in PSI (or GTmetrix Waterfall chart) and they’ll list all third-party domains loading on your site. Other than CDN URLs + third-party fonts which you’ll use preconnect, the rest should be prefetched.
4. Lazy Loading
Permatters gives you more lazy load settings than some cache plugins with a viewport threshold and fade in effect, so it really depends on how effective your cache plugin is.
- Images: ON – while using JS is said to be worse (what Perfmatters uses), they say it only adds 2.5KB and is better than native lazy load since more resources can be lazy loaded. If you enable it, native lazy loading in WordPress will be disabled and will show the option to exclude leading images. I wouldn’t use this because the number of images shown above the fold can be different depending on the page/post (excluding them manually is better).
- iFrames And Videos: ON – lazy loads iframes and replaces iframes with a preview image so the “fat YouTube player” is only loaded when clicked. I have this enabled in FlyingPress which also hosts the thumbnails locally to prevent third-party requests from ytimg.com.
- Exclude From Lazy Loading – above the fold images should be excluded from lazy load which can improve LCP. Copy those image URLs and add them so they’re not lazy loaded.
- Threshold: 0px – increasing this results in a smoother scrolling experience since images start loading before they’re shown in the viewport, but 0px is the most aggressive option.
- DOM Monitoring – OFF (only enable if you use infinite scrolling). Perfmatters 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…”
- Add Missing Images Dimensions: ON – adds width/height to images without dimensions to prevent layout shifts while fixing the “use explicit width + height” PSI recommendation.
- Fade In: ON – adds a fade in effect for lazy loaded images so they don’t jump in suddenly.
- Disable Google Fonts: OFF – only use if you’re in the process of using system fonts or custom fonts and need to disable them. Otherwise, it removes Google Fonts on your site.
- Display Swap: ON – adds font-display: swap to the font CSS which can fix “ensure text remain visible during webfont load” in PSI. While it fixes FOIT (flash of invisible text) by setting a fallback font, it can also cause FOUC (flash of unstyled text) which can look ugly.
- Local Google Fonts: ON – downloads fonts.google.com fonts and hosts them locally.
- CDN URL: add your CDN URL to serve self-hosted fonts from your CDN (i.e. BunnyCDN).
- Enable CDN Rewrite – ON – if you’re using a CDN URL, this rewrites assets to be served from the CDN (i.e. https://cdn.yourwebsite.com/wp-content/uploads/2022/02/logo.png). Sometimes adding your CDN URL to multiple plugins can serve more assets from the CDN.
- CDN URL: add your CDN URL – I recommend Cloudflare with BunnyCDN (or FlyingCDN).
- Included Directories: generally 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: .php,.xml is recommended when using SEO plugins with XML sitemaps.
- Enable Local Analytics: ON – host locally to prevent third-party GA requests.
- Tracking ID: enter your Google Analytics tracking ID so it can be hosted locally.
- Tracking Code Position: Header (Default) is what’s recommended by Google.
- Script Type: analytics.js or minimal – these have smaller file sizes compared to other types, but disables some data in Google Analytics. Read the Perfmatters documentation and decide whether you want to disable the data in return for a small performance boost.
- Disable Display Features: ON – disables remarketing and advertising options in GA which isn’t used by most people and prevents a second HTTP request to DoubleClick.
- Anonymize IP: ON – shortens IP address to comply with GDPR in some countries.
- Track Logged In Admins: OFF – you don’t want admin visits in your analytics data.
- Adjusted Bounce Rate: 30 – if visitors stay for longer than 30 seconds, they won’t be considered a bounce. This is recommended by Perfmatters and is on a scale from 1-100.
- Use MonsterInsights: OFF – only enable if using MonsterInsights to host GA locally.
- Enable AMP Support: : OFF – only enable if you’re using AMP which I don’t recommend.
Otherwise, I would remove everything but post revisions + post auto-drafts since you want to keep (at least a few) backups of posts. Sometimes I get automatic Windows updates that close everything down. Thankfully, the auto-drafts have saved me from losing work quite a few times.
Perfmatters With A Good Cache Plugin Is The Way To Go
I feel like the Perfmatters team saw all the things lacking in (most) cache plugins then added it to their plugin. Perfmatters with FlyingPress or LiteSpeed Cache is definitely the way to go IMO.
|Asset CleanUp||SG Optimizer||WP Rocket||FlyingPress||Perfmatters|
|Remove unused CSS||x||x||Inline||Separate file||Separate file|
|Host analytics locally||x||x||x||x||✓|
|Smaller GA tracking code||x||x||x||x||✓|
|Host fonts locally||✓||x||x||✓||✓|
|Exclude above the fold images||x||By class||By URL||By number||By number|
|Preload critical images||x||By class||By URL||By number||By number|
|Lazy load background images||x||Inline||Helper class||Helper class||CSS|
|Specify image dimensions||x||x||✓||✓||✓|
|Change autosave interval||x||x||x||x||✓|
|Limit post revisions||x||x||x||x||✓|