---
title: "Configure Netlify Build Plugins to run only in specific deploy contexts"
description: "Learn how to customize your Netlify build process with Build Plugins that run differently (or not at all) across production, Deploy Preview, and branch deploy contexts."
source: "https://www.netlify.com/blog/2021/05/06/now-available-configure-build-plugins-by-deploy-context/"
last_updated: "2026-07-10T19:43:51.000Z"
---
Now you can configure any of Netlify’s Build Plugins so they run only in specific deploy contexts!

As a quick refresher: [deploy contexts](https://docs.netlify.com/site-deploys/overview/#deploy-contexts) refer to the different types of deploys of your site on Netlify, including production deploys to your primary site URL, Deploy Previews, and branch deploys built from a specific branch of your site repository. In your `netlify.toml` file, you can specify different build settings for different contexts. For example, you may want separate build configurations for staging vs. production environments.

Netlify [Build Plugins](https://docs.netlify.com/configure-builds/build-plugins/) allow you to extend and customize your build processes with a combination of tools from a library of services. For example, you could use a build plugin to fail the build if it doesn’t meet accessibility requirements or kick off a search indexing process with [Algolia](https://www.netlify.com/integrations/algolia/) after every successful deploy.

By default, installed plugins run in all deploy contexts. Until now, there was no way to tell certain plugins to run only in some contexts or to apply context-specific plugin settings.

Today, we’re excited to announce you can now define the context where a plugin should run, and even further configure the plugin based on specific contexts.

In order to configure contexts, you will need to edit your `netlify.toml` file.

You can choose to enable or disable a plugin only in specific contexts, like so:

```
[[context.production.plugins]]package = "@netlify/plugin-sitemap"
```

You can also configure a plugin to run with different `inputs` depending on the context:

```
[[plugins]]package = "netlify-plugin-cypress"  [plugins.inputs]  record = true
[[context.deploy-preview.plugins]]package = "netlify-plugin-cypress"  [context.deploy-preview.plugins.inputs]  record = false
```

## Example use cases for context-specific plugins

Thinking about switching up your plugins based on different contexts? Here are some ideas for example use cases:

-   Save time while you’re working by running certain plugins, like [Image Optim](https://github.com/chrisdwheatley/netlify-plugin-image-optim) or [Sitemap](https://github.com/netlify-labs/netlify-plugin-sitemap#readme), only when you’re ready to deploy to production.
-   Save time when you’re ready to ship by moving some testing plugins, like the [A11y plugin](https://github.com/netlify-labs/netlify-plugin-a11y#readme), to run checks only on your deploy previews but not when you’re pushing to prod.
-   Reduce noise from notifications while you work by running plugins like [Pushover notification](https://github.com/AshikNesin/netlify-plugin-pushover#readme) only when you’re deploying to production and not every time a PR is made.
-   Configure an end-to-end testing plugin like [Cypress](https://github.com/cypress-io/netlify-plugin-cypress#readme) so that it runs _after_ the deploy for previews, but _before_ the deploy for production. That way, you get full E2E experience during development and test, but don’t risk having a failing production build go live.

## A few details to note

Plugins that are installed by clicking the **Install** button in the Netlify UI run in all contexts. To run a plugin only in a specific context, [configure it](https://docs.netlify.app/configure-builds/build-plugins/#configure-by-deploy-context) in your `netlify.toml` file under that context only, and make sure the plugin is not installed in the UI.

On the other hand, changes to plugin `inputs` will take precedence and work as set in the `netlify.toml` file, even if the plugin was installed via the web app UI.

## Try context-specific plugins today!

Go browse the Netlify [plugin directory](https://app.netlify.com/plugins) to see the full list of available plugins. Then, head over to [the docs](https://docs.netlify.com/configure-builds/build-plugins/#configure-by-deploy-context) to learn how to configure your plugins by context.

We’re so glad to make this highly-requested enhancement available to all Netlify customers on all plans today. Keep the feedback coming!

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=Now available: Configure Build Plugins by deploy context&url=https://www.netlify.com/blog/2021/05/06/now-available-configure-build-plugins-by-deploy-context//)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2F2021%2F05%2F06%2Fnow-available-configure-build-plugins-by-deploy-context%2F%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/2021/05/06/now-available-configure-build-plugins-by-deploy-context//)
-   [Bluesky](https://bsky.app/intent/compose?text=Now available: Configure Build Plugins by deploy context+https://www.netlify.com/blog/2021/05/06/now-available-configure-build-plugins-by-deploy-context//)

* * *

### Tags

-   [Build Plugins](/blog/tags/build-plugins/)
-   [Deploys](/blog/tags/deploys/)

## Keep reading

![](/images/blog-fallback-thumbnail.svg)

Tools & Services January 25, 2021

[

### Top 10 Netlify Build Plugins - 2021 Update

](/blog/2021/01/25/top-10-netlify-build-plugins-2021-update/)

-   ![Profile picture of Melanie Crissey](/_astro/ca2e7ff6f97a809119f3c1b9bf99a437eab6b3c4-956x956_WHlf.webp)
    
    Melanie Crissey
    

![](/images/blog-fallback-thumbnail.svg)

News & Announcements May 27, 2020

[

### Netlify Build Plugins Are Here!

](/blog/2020/05/27/netlify-build-plugins-are-here/)

-   ![Profile picture of Tara Z. Manicsic](/_astro/2ac74d0595066130d59f8c97e61332017cdbcb94-1000x921_ZyTafG.webp)
    
    Tara Z. Manicsic
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)