---
title: Remove an attribute
source: https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-attribute
---

## Android

### Syntax [#syntax]

#### Java [#java]

```java
NewRelic.removeAttribute(string $name)
```

#### Kotlin [#kotlin]

```kotlin
NewRelic.removeAttribute(name: String?)
```

### Description [#description]

This method removes an attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type     | Description                                                  |
| --------- | -------- | ------------------------------------------------------------ |
| `$name`   | `string` | Required. The name of the attribute that you want to remove. |

### Return values [#return-values]

Returns `true` if recorded successfully, and `false` if it doesn't.

### Example [#example]

Here's an example of removing an attribute named `rate`:

#### Java [#java]

```java
boolean attributeRemoved = NewRelic.removeAttribute("rate");
```

#### Kotlin [#kotlin]

```kotlin
val attributeRemoved = NewRelic.removeAttribute("rate")
```

## iOS

### Syntax [#syntax]

#### Objective-c [#objc]

```objectivec
removeAttribute:(NSString*)name;
```

#### Swift [#swift]

```swift
NewRelic.removeAttribute(_ name: : String!)-> Bool
```

### Description [#description]

This method removes the attribute specified by the name string from the session. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type       | Description                                                  |
| --------- | ---------- | ------------------------------------------------------------ |
| `name`    | `NSString` | Required. The name of the attribute that you want to remove. |

### Return values [#return-values]

Returns `true` if recorded successfully, and `false` if it doesn't.

### Examples [#examples]

#### Objective-C [#obj-c]

Here's an example to remove the session attribute specified by a `NSString*` named `rate`:

```objectivec
BOOL attributeRemoved = [NewRelic removedAttribute@"rate"];
```

#### Swift [#swift]

Here's an example to remove the session attribute specified by a `string` named `rate`:

```swift
let attributeRemoved = NewRelic.removedAttribute("rate")
```

## Capacitor

### Syntax [#syntax]

```typescript
removeAttribute(options: { name: string; }) => void
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type     | Description                          |
| --------- | -------- | ------------------------------------ |
| `name`    | `string` | Required. The name of the attribute. |

### Example [#example]

```typescript
NewRelicCapacitorPlugin.removeAttribute({ name: "CapacitorAttribute" });
```

## Cordova

### Syntax [#syntax]

```typescript
removeAttribute(name: string): void;
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type     | Description                          |
| --------- | -------- | ------------------------------------ |
| `name`    | `string` | Required. The name of the attribute. |

### Example [#example]

```js
NewRelic.removeAttribute({ name: "CordovaAttribute" }); void
```

## Flutter

### Syntax [#syntax]

```dart
removeAttribute(name: string): void;
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type     | Description                          |
| --------- | -------- | ------------------------------------ |
| `name`    | `string` | Required. The name of the attribute. |

### Example [#example]

```dart
NewrelicMobile.instance.removeAttribute("FlutterCustomAttrNumber");
```

## .NET MAUI

### Syntax [#syntax]

```csharp
RemoveAttribute(string name) : bool;
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type   | Description                          |
| --------- | ------ | ------------------------------------ |
| `name`    | `bool` | Required. The name of the attribute. |

### Example [#example]

```csharp
CrossNewRelic.Current.RemoveAttribute("MAUINumAttr");
```

## React Native

### Syntax [#syntax]

```js
removeAttribute(name: string): void;
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type     | Description                          |
| --------- | -------- | ------------------------------------ |
| `name`    | `string` | Required. The name of the attribute. |

### Example [#example]

```js
NewRelic.removeAttribute('RNCustomAttrNumber');
```

## Unity

### Syntax [#syntax]

```csharp
RemoveAttribute(string name) : bool;
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type     | Description                          |
| --------- | -------- | ------------------------------------ |
| `name`    | `string` | Required. The name of the attribute. |

### Example [#example]

```csharp
NewRelicAgent.RemoveAttribute("UnityCustomAttrNumber");
```

## Unreal Engine

### Syntax [#syntax]

```cpp
removeAttribute(FString name) : void;
```

### Description [#description]

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see [Remove all attributes](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/remove-all-attributes).

### Parameters [#parameters]

| Parameter | Type      | Description                          |
| --------- | --------- | ------------------------------------ |
| `name`    | `FString` | Required. The name of the attribute. |

### Example [#example]

```cpp
#include "NewRelicBPLibrary.h"

UNewRelicBPLibrary::removeAttribute("Unreal String");
```

![Screenshot of the Unreal Engine Plugin Remove Attributes](https://docs.newrelic.com/images/newrelic_unreal_sdk_remove_attribute.webp "Unreal Engine Plugin Remove Attributes")
