---
title: ignore_transaction (Python agent API)
source: https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/ignoretransaction-python-agent-api
---

## Syntax

```py
newrelic.agent.ignore_transaction(flag=True)
```

Ignores the current transaction.

## Description

This call ignores the current transaction. The agent does not report any data from the transaction.

> #### 💡 TIP
>
> You can also ignore a web transaction in the WSGI environ dictionary. To do so, set the `newrelic.ignore_transaction` key for the specific request in the WSGI environ dictionary passed by the WSGI server into your WSGI application.

## Parameters

| Parameter        | Description                                                                                                              |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `flag` _boolean_ | Optional. Default is `True`. If the transaction is already ignored, you can un-ignore it by setting the flag to `False`. |

## Return values

None.

## Examples

### Ignore a transaction [#ignore-example]

To ignore a transaction that you don't want to show up in the UI, you would run the following where a transaction is being generated in your app code. This example illustrates using the API to ignore a Flask route:

```py
@app.route("/")
def process_results():
    newrelic.agent.ignore_transaction(flag=True)
    return 'hello world'
```
