> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-cms/17.latest/extend-your-project/backoffice-extensions/extending-overview/extension-registry/replace-exclude-or-unregister.md).

# Replace, Exclude, or Unregister

Besides adding extensions to Umbraco, sometimes you want to change what is already there. You can replace extensions with your own and exclude or unregister extensions.

## Replace

You can replace an existing extension by another one. You can do this by defining the `overwrites` property in your [Extension Manifest](/umbraco-cms/17.latest/extend-your-project/backoffice-extensions/extending-overview/extension-registry/extension-manifest.md) with one Extension Alias. For multiple `overwrites` you can provide the Extension Aliases that need to be replaced as an array.

This example overrides the `save and preview` button with an external "preview" button (single overwrite):

```typescript
const manifest = {
    type: 'workspaceAction',
    alias: 'my.WorkspaceAction.ExternalPreview',
    name: 'My workspace action for external preview',
    overwrites: 'Umb.WorkspaceAction.Document.SaveAndPreview'
    ...
};
```

This example overrides both the `save and preview` button as well as the `save` button with an external "preview" button (multiple overwrite):

```typescript
const manifest = {
    type: 'workspaceAction',
    alias: 'my.WorkspaceAction.ExternalPreview',
    name: 'My workspace action for external preview',
    overwrites: ['Umb.WorkspaceAction.Document.SaveAndPreview', 'Umb.WorkspaceAction.Document.Save']
    ...
};
```

If your extension has conditions, the overwritten extensions will only be hidden when your extension is displayed. This means that the overwrites only have an effect if all the conditions are permitted and the extensions are displayed at the same spot.

## Exclude

When you exclude an extension, the extension will never be displayed. This allows you to permanently hide, for example, a menu or a button. This does not unregister the extension, but rather flags it as excluded. This also means that no one else can register an extension with the same alias as the excluded extension.

{% hint style="warning" %}
Currently, it is not possible to un-exclude extensions once excluded.
{% endhint %}

The following JavaScript code hides the `Save and Preview` button from the Document Workspace.

```typescript
import { UmbExtensionRegistry } from '@umbraco-cms/backoffice/extension-api';

UmbExtensionRegistry.exclude('Umb.WorkspaceAction.Document.SaveAndPreview');
```

When and where you execute this code depends on your situation. In many cases, it makes sense to execute this on boot, using the [entry point approach](/umbraco-cms/17.latest/extend-your-project/backoffice-extensions/extending-overview/extension-types/backoffice-entry-point.md).

## Unregister

You can also choose to unregister an extension. You should only use this on extensions you registered yourself and have control over. Otherwise, you might try to remove an extension before it is registered. A use case for this, is if you temporarily registered an extension and you want to remove it again.

In other cases, you can use the `overwrites` or `exclude` option. The difference with the `exclude` approach is that unregistering removes the extension from the Extension Registry. This allows you to re-register extensions with the same alias.

```typescript
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';

umbExtensionsRegistry.unregister('My.WorkspaceAction.AutoFillWithUnicorns');
```

When and where you execute this code depends on your situation. In many cases, it makes sense to execute this on boot, using the [entry point approach](/umbraco-cms/17.latest/extend-your-project/backoffice-extensions/extending-overview/extension-types/backoffice-entry-point.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.umbraco.com/umbraco-cms/17.latest/extend-your-project/backoffice-extensions/extending-overview/extension-registry/replace-exclude-or-unregister.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
