---
title: "Control a patch file setting"
slug: "control-a-patch-file-setting"
abstract: "How to control whether a patched setting is merged with an existing setting or added as a new setting."
---
# Control a patch file setting

When you use patch files to change the configuration, you must identify the node you want to add or update. By default, updates existing nodes with the patched attributes, but you can use significant attributes to force to add new nodes instead.

This topic explains how to:

- [Specify a node](https://doc.sitecore.com/xp/en/developers/101/platform-administration-and-architecture/control-a-patch-file-setting.html#UUID-4bc8ca32-93fc-1b21-72b4-afc9ab710222_N1527495128937 "Specify a node")
- [Use a significant attribute](https://doc.sitecore.com/xp/en/developers/101/platform-administration-and-architecture/control-a-patch-file-setting.html#UUID-4bc8ca32-93fc-1b21-72b4-afc9ab710222_N1527496376330 "Use a significant attribute")
- [Add a significant attribute definition](https://doc.sitecore.com/xp/en/developers/101/platform-administration-and-architecture/control-a-patch-file-setting.html#UUID-4bc8ca32-93fc-1b21-72b4-afc9ab710222_N1527496364526 "Add a significant attribute definition")

## Specify a node

You must specify which node you want to update.

To specify the node:

- Specify the element name and its place in the XML structure in the `Sitecore.config` file.

For example, the `AliasActive` setting is part of the `<settings>` element node, which is part of the `<sitecore>` element node. To change the value of the `AliasActive` setting to false you must include these element nodes in the patch file:

```xml
<sitecore>
 <settings>
   <setting name="AliasActive">
     <patch:attribute name="value">False</patch:attribute>
   </setting>
 </settings>
</sitecore>

```

## Use a significant attribute

When processes attributes from patch files, it looks for existing nodes in the `Sitecore.config` file that fit the attributes in the patch file node. If it finds one, by default, it merges the attributes in the patch file with the existing node.

For example, you can have two patch files that both add a script file to the `<clientscripts>` node in the `Sitecore.config` file:

```xml
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
 <clientscripts>
 <script src="script-1.js" language="javascript" />
 </clientscripts>
  </sitecore>
</configuration>

```

```xml
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
 <clientscripts>
 <script src="script-2.js" language="javascript" att1="test" />
 </clientscripts>
  </sitecore>
</configuration>

```

When processes the first patch file, it adds the `<script src="script-1.js">` element. When it processes the second patch file, it merges the new information with the first `<script>` element, updating the `src` attribute and adding the `att1` attribute. The final result is:

```xml
<sitecore>
 <clientscripts>
   <script src="script-2.js" language="javascript" att1="test" patch:source="Add-script-2.config"
/>
 </clientscripts>
</sitecore>

```

If you want to add the node from the second patch file as a new node, you can add a significant attribute to the node definition. never merges significant attributes, so if the second `script` element includes a significant attribute with a unique value, adds it as a new element. For example, you can add a `desc` attribute to the `script` element in the second patch file:

```xml
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
 <clientscripts>
 <script src="script-2.js" language="javascript" att1="test" desc="new script" />
 </clientscripts>
  </sitecore>
</configuration>

```

The result after processing both patch files is now:

```xml
<sitecore>
    <clientscripts>
        <script src="script-1.js" language="javascript" patch:source="Add-script-1.config" />
        <script desc="new script" src="script-2.js"
            language="javascript" att1="test" patch:source="Add-script-2.config" />
    </clientscripts>
</sitecore>

```

You can use the following significant attributes in this way:

- ancestor
- assembly
- builderType
- category
- channelId
- comment
- contains
- creationType
- desc
- description
- displayName
- extensions
- facetKey
- fieldId
- fieldName
- fieldType
- fieldTypeName
- file
- find
- folder
- groupName
- hint
- hostname
- id
- implementationType
- innerText
- interface
- key
- messageDataType
- messageItemBaseType
- method
- name
- namespace
- networkName
- originalKey
- path
- postingConfiguration
- prefix
- providerName
- querystring
- ref
- region
- serviceType
- sitecoreKey
- statusCode
- tagName
- templateId
- trafficType
- trigger
- type
- typeConverter
- typeName
- uid
- urlReferrerHost
- value
- verb
- viewName
- with
- xmlControl
- xmlns

To change the value of a significant attribute in an existing node:

- Use the patch:attribute syntax:

    ```xml
    <sitecore>
     <clientscript >
       <script src="script-1.js" att1="test">
         <patch:attribute name="desc">new description</patch:attribute>
       </script>
     </clientscript>
    </sitecore>
    ```

## Add a significant attribute definition

If you cannot use any of the default significant attributes, you can define your own.

To define your own significant attribute:

- Add the significant attribute to the `Sitecore.config` file, within the `<sitecore>` element node.

For example, the following adds a significant attribute called `my-own-attribute`:

```xml
<patch>
  <significantAttributes>
  <add name="my-own-attribute"/>
  </significantAttributes>
</patch>

```

> [!important]
> processes its list of significant attributes before it processes the patch files. You must therefore add new significant attributes directly to the `Sitecore.config` file and you cannot add them through a patch file. Only use this method if you absolutely cannot use any of the predefined attributes.