What are NitroPack’s Excluded Resources for WordPress?

Table of contents

What are NitroPack’s Excluded Resources for WordPress?

TL;DR

Excluded Resources lets you tell NitroPack exactly which scripts, stylesheets, or assets to leave untouched during optimization. Perfect for preventing conflicts, preserving third-party functionality, or debugging with ease.

Website optimization isn’t one-size-fits-all. Some files—especially critical scripts, A/B testing libraries, or custom integrations—just shouldn’t be touched.

That’s where Excluded Resources comes in.

This feature gives you precise control over which CSS, JS, images, and fonts need to be skipped during optimization. Whether you want to avoid interfering with a delicate third-party script, preserve tracking accuracy, or troubleshoot a stubborn layout issue, this tool puts you in charge of a faster WordPress site.

What are Excluded Resources?

In web performance optimization, tools often compress, defer, or reorder JavaScript and CSS to speed up websites. But not all resources should be touched.

Some files are critical for functionality or need to load in a very specific way—especially third-party scripts like payment gateways, chat widgets, or analytics. Optimizing these can lead to broken layouts, malfunctioning buttons, or even failed API calls.

Excluded Resources let developers mark certain scripts or stylesheets to be skipped during optimization—ensuring they’re delivered exactly as written.

With vs Without Excluded Resources (Example)

Imagine you’re using a payment provider’s JavaScript that must remain untouched to ensure security and compatibility. With Excluded Resources, you can prevent NitroPack from optimizing or delaying that script—avoiding conflicts without compromising overall performance.

ScenarioWithout Excluded ResourcesWith Excluded Resources
Optimizing a third-party widgetMay break due to minificationLeft untouched and fully functional
Custom admin scriptMay load incorrectlyExcluded to preserve original logic
Sensitive JS from API providerCould trigger compatibility issuesSafely skipped by NitroPack

Excluded Resources are a great optimization technique for: 

  • eCommerce: Exclude third-party checkout scripts to avoid transaction errors.
  • Marketing Sites: Keep analytics and tag manager scripts untouched for clean tracking.
  • Multilingual Sites: Avoid breaking translation tools by excluding their JS.

Why Are Excluded Resources Important?

Here’s why selective exclusion can make a big difference:

  • Maintain Load Order: Certain elements, like animations or forms, may depend on strict timing.
  • Avoid Third-party Conflicts – Some scripts don’t play well with optimization. Excluding them prevents unwanted behavior.
  • Preserve Functionality – Mission-critical resources remain stable and unmodified.
  • Reduce Debug Time – Know exactly what’s being excluded to isolate performance issues more quickly.
  • Enable Gradual Optimization – Great for debugging or rolling out changes in stages.

Additionally, using excluded resources strategically can help reduce or fix several Google PageSpeed Insights warnings:

By excluding the right resources, you maintain stability while improving metrics like First Contentful Paint (FCP) and Time to Interactive (TTI).

Excluded Resources by NitroPack Explained

When you use this feature, NitroPack checks the URLs of CSS and JavaScript files. If a match is found based on your exclusion rules, NitroPack leaves the file out of the optimization process.

You can exclude resources based on:

  • File name or partial URL
  • File type (JS, CSS, image, font)
  • Resource relations (inline or external)
  • Device type (mobile, desktop, or tablet)

This is particularly useful for:

  • Custom scripts that should not be minified or deferred
  • Critical tracking or analytics tools
  • Third-party scripts that rely on specific load behavior

NitroPack vs No Resource Exclusion 

FeatureNo ExclusionWith Excluded Resources
Optimizes every file✅ Yes❌ Excludes specific files
Risk of script breakage✅ Higher❌ Reduced
Control for developers❌ Limited✅ High
Best for fragile integrations❌ Risky✅ Safe and stable

How to Use Excluded Resources by NitroPack

To use this feature:

  1. Go to your NitroPack dashboard
  2. Navigate to Cache Settings >> Cache
  3. Enable “Excluded Resources”
  4. Enter the URL/code of the file(s) you want to exclude
  5. Choose the different filters from the drop down menus
  6. Save to apply changes

After configuration, NitroPack will skip those resources during all future optimizations.

💡 Important tips

Exclude with Purpose: Don’t exclude everything—it reduces optimization benefits.
Avoid Duplicates: Exclude only once per file, even if it’s used across pages.

Test on Staging First: Always validate exclusions in a safe environment before going live.

For more advanced setup tips, visit our Excluded Resources guide.

Leverage 50+ automated optimizations and
control script behavior with NitroPack →

FAQs

Can I exclude inline scripts or styles?

Yes, you can. After entering the file’s URL/code, from the Resource Relation drop-down menu, choose “Inline.”

What if I exclude the wrong resource?

You can remove it from the exclusion list anytime from the dashboard.

Does excluding resources hurt performance?

It depends. If the excluded file is large or render-blocking, it might impact performance. Use this feature strategically.

How can I identify what to exclude?

Start with any file that breaks functionality when optimized or deferred. Testing tools and browser dev tools can help.

Lora Raykova
By Lora Raykova

User Experience Content Strategist

Lora has spent the last 8 years developing content strategies that drive better user experiences for SaaS companies in the CEE region. In collaboration with WordPress subject-matter experts and the 2024 Web Almanac, she helps site owners close the gap between web performance optimization and real-life business results.