---
title: Enable or disable attributes
source: https://docs.newrelic.com/docs/apm/agents/php-agent/attributes/enable-or-disable-attributes
---

Learn about properties to enable or disable attributes, and the rules that New Relic uses when determining which attributes to include or exclude for a [destination](https://docs.newrelic.com/docs/features/agent-attributes#destinations). This also includes a summary of the PHP agent properties that have been deprecated with the release of New Relic agent attributes.

## Properties

Use the following destination properties to open or close the destination to any attribute collection:

**`newrelic.attributes.enabled`**

| Type    | Boolean |
| ------- | ------- |
| Default | True    |

Turns on or turns off all attributes in all destinations.

**`newrelic.browser_monitoring.attributes.enabled`**

| Type:    | Boolean |
| -------- | ------- |
| Default: | False   |

Turns on or turns off all attributes for browser monitoring. This is the data that gets attached to page view events. If `newrelic.attributes.enabled` is `false`, no attributes will be sent to browser monitoring regardless of how this property is set.

**`newrelic.error_collector.attributes.enabled`**

| Type:    | Boolean |
| -------- | ------- |
| Default: | True    |

Turns on or turns off all attributes for traced errors. If `newrelic.attributes.enabled` is `false`, no attributes will be sent to traced errors regardless of how this property is set.

**`newrelic.transaction_events.attributes.enabled`**

| Type:    | Boolean |
| -------- | ------- |
| Default: | True    |

Turns on or turns off all attributes for transaction events. If `newrelic.attributes.enabled` is `false`, no attributes will be sent to transaction events regardless of how this property is set.

**`newrelic.transaction_tracer.attributes.enabled`**

| Type    | Boolean |
| ------- | ------- |
| Default | True    |

Turns on or off all attributes for transaction traces. If `newrelic.attributes.enabled` is `false`, no attributes will be sent to transaction traces regardless of how this property is set.

**`newrelic.span_events.attributes.enabled`**

| Type    | Boolean |
| ------- | ------- |
| Default | True    |

Turns on or off all attributes for `Span` data. If `newrelic.attributes.enabled` is `false`, no attributes will be sent to spans regardless of how this property is set.

Use the following attribute/destination specific `.include` or `.exclude` properties to add or remove specific attributes in specific destinations:

**`newrelic.attributes.include`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

If attributes are enabled, all attribute keys in this list will be sent to New Relic.

**`newrelic.attributes.exclude`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

All attribute keys in this list will **not** be sent to New Relic.

**`newrelic.browser_monitoring.attributes.include`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

If attributes are enabled for `browser_monitoring`, all attribute keys in this list will be sent in page view data.

**`newrelic.browser_monitoring.attributes.exclude`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

All attribute keys found in this list will **not** be sent to New Relic in page views.

**`newrelic.error_collector.attributes.include`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

If attributes are enabled for traced errors, all attribute keys in this list will be sent to New Relic in traced errors.

**`newrelic.error_collector.attributes.exclude`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

All attribute keys in this list will **not** be sent to New Relic in traced errors.

**`newrelic.transaction_events.attributes.include`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

If attributes are enabled for transaction events, all attribute keys in this list will be sent to New Relic in transaction events.

**`newrelic.transaction_events.attributes.exclude`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

All attribute keys in this list will **not** be sent to New Relic in transaction events.

**`newrelic.transaction_tracer.attributes.include`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

If attributes are enabled for transaction traces, all attribute keys in this list will be sent to New Relic in transaction traces.

**`newrelic.transaction_tracer.attributes.exclude`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

All attribute keys in this list will **not** be sent to New Relic in transaction traces.

**`newrelic.span_events.attributes.include`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

If attributes are enabled for span events, all attribute keys in this list will be sent to New Relic in span events.

**`newrelic.span_events.attributes.exclude`**

| Type:    | Comma-delimited list of strings |
| -------- | ------------------------------- |
| Default: | Empty                           |

All attribute keys in this list will **not** be sent to New Relic in span events.

## Attribute rules [#attruls]

New Relic follows these rules when determining which attributes to include or exclude for a destination.

**Root level takes precedence for enabled.**

The `newrelic.attributes.enabled` field trumps all other settings. When `false`, no attributes will be reported to New Relic.

Example configuration:

````ini
newrelic.attributes.enabled = false
newrelic.attributes.include = foo,bar
newrelic.transaction_tracer.attributes.enabled = true
```

Example output:

```
Keys passed in: password, foo, bar, bat
Keys included for all destinations:
Keys excluded for all destinations: password, foo, bar, bat
```

````

**Destination enabled takes precedence over include and exclude.**

`newrelic.{destination}.attributes.enabled` flags take precedence over include and exclude keys.

Example configuration:

````ini
newrelic.transaction_tracer.attributes.enabled = false
newrelic.attributes.include = one,two
newrelic.transaction_tracer.attributes.include = three,four
```

Example output:

```
Keys passed in: one, two, three, four
Keys included for transaction traces:
Keys excluded for transaction traces: one, two, three, four
```

````

**Attribute is included if the destination is enabled.**

If a destination is enabled, all user attributes are sent to that destination by default.

All user attributes default to `true`. However, by default, request attributes and message parameters are disabled for all destinations.

Example configuration:

````ini
newrelic.attributes.enabled = true
newrelic.attributes.exclude = myAttKey
```

Example output:

```
Keys passed in: foo, bar, myAttKey
Keys included: foo, bar
Keys excluded: myAttKey
```

````

**Exclude always supersedes include.**

If the same key is listed in the include and exclude lists, then attributes with the specified key will be excluded.

Example configuration:

````ini
newrelic.attributes.enabled = true
newrelic.attributes.include = foo,myCustomAtt
newrelic.attributes.exclude = password,myCustomAtt
```

Example output:

```
Keys passed in: foo, myCustomAtt, password
Keys included: foo
Keys excluded: password, myCustomAtt
```

````

**Keys are case sensitive.**

Keys are case sensitive.

Example configuration:

````ini
newrelic.attributes.enabled = true
newrelic.attributes.exclude = password,PaSsWoRd
```

Example output:

```
Keys passed in: password, Password, PASSWORD, PaSsWoRd, PassWORD
Keys included: Password, PASSWORD, PassWORD
Keys excluded: password, PaSsWoRd
```

````

**Use a star (`\*`) for wildcards.**

You can use an asterisk or star (`*`) at the end of a key as a wildcard. This will match a set of attributes with the same prefix.

Example configuration:

````ini
newrelic.attributes.enabled = true
newrelic.attributes.include = custom*
newrelic.attributes.exclude = request.parameters.*
```

Example output:

```
Keys passed in: custom, custom.key1, custom.key2, request.parameters., request.parameters.foo, request.parameters.bar
Keys included: custom, custom.key1, custom.key2
Keys excluded: request.parameters., request.parameters.foo, request.parameters.bar
```

````

**Most specific setting for a key takes priority.**

If multiple include or exclude attributes affect the same key, the most specific setting will have priority.

Example configuration:

````ini
newrelic.attributes.enabled = true
newrelic.attributes.include = request.parameters.foo
newrelic.attributes.exclude = request.parameters.*
```

Example output:

```
Keys passed in: request.parameters., request.parameters.foo, request.parameters.bar
Keys included: request.parameters.foo
Keys excluded: request.parameters., request.parameters.bar
```

````

**Include or exclude affects the specific destination.**

If the attribute include or exclude is specified on a destination, then it only impacts that destination.

Example configuration:

````ini
newrelic.attributes.include = foo
newrelic.transaction_events.attributes.exclude = foo
```

Example output:

```
Keys passed in: foo
Keys included for transaction events: 
Keys included for other destinations: foo
Keys excluded for transaction events: foo
```

````

## Deprecated properties [#deprecated]

The following properties have been deprecated. Switch to the new attributes configuration for these properties when upgrading your PHP agent.

| **Deprecated property**                     | **New property**                                                                                                                                                                                                                                                                   |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `newrelic.capture_params`                   | `newrelic.attributes.include = request.parameters.*` By default, request parameters are not sent to New Relic. Add `request.parameters.*` to the `newrelic.attributes.include` list to turn on all request parameters. The `newrelic.capture_params` property has been deprecated. |
| `newrelic.ignored_params`                   | `newrelic.attributes.exclude = request.parameters.{name}` Add each request parameter key to the `newrelic.attributes.exclude` list, delimited by commas. Be sure to prepend the key with `request.parameters`. The `newrelic.ignored_params` property has been deprecated.         |
| `newrelic.{destination}.capture_attributes` | `newrelic.{destination}.attributes.enabled` The old `newrelic.{destination}.capture_attributes` flag would turn off user attribute collection. This has been deprecated. Use `newrelic.{destination}.attributes.enabled` instead.                                                  |
