---
title: Uninstall (remove) the C SDK
source: https://docs.newrelic.com/docs/apm/agents/c-sdk/install-configure/uninstall-remove-c-sdk
---

> #### ⚠️ EOL NOTICE
>
> From April 2022, we don't support the C SDK capability. For more details, see our [Support Forum post](https://support.newrelic.com/s/hubtopic/aAX8W0000008d0r/q1-bulk-eol-announcement-fy23).

Follow these procedures as appropriate to temporarily disable the C SDK in your app's code library or to remove it completely.

## Write instrumentation you can disable [#disable]

As a C library that provides direct access to the New Relic API, the C SDK cannot be turned on or off directly. However, you can write your code for the SDK so that a quick recompile and deploy can enable or disable your instrumentation.

One approach is to use an `#ifdef` macro. By surrounding all your instrumentation in `#ifdef` macros and setting the value of `YOURNAMESPACE_NEWRELIC_ENABLED` with your build system, you will be able to quickly enable or disable New Relic's instrumentation in your C/C++ based programs by recompiling them and then redeploying the application.

**Using #ifdef macros to disable C SDK instrumentation**

````c
// replace `YOURNAMESPACE` with something that's unique to
// your company/project to ensure a unique name
#ifdef YOURNAMESPACE_NEWRELIC_ENABLED
int priority = 50;
newrelic_txn_t* txn = newrelic_start_non_web_transaction(app, transaction_name);

...

if (err) {
  newrelic_notice_error(txn, priority, "Meaningful error message", "Error.class");
}

...

newrelic_end_transaction(&txn);
#endif
```

````

## Uninstall completely [#uninstall]

To remove the New Relic C SDK completely from your app's code library:

1.  Remove the linking to `libnewrelic.a` in your build system.
2.  Remove all New Relic API calls from your application code.
3.  Recompile and redeploy your application.
