---
title: "Search and Replace plugin"
description: "Find and replace content in TinyMCE."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/searchreplace/"
md_url: "https://www.tiny.cloud/docs/tinymce/7/searchreplace/index.md"
version: "7"
last_updated: "2022-03-30T07:08:51Z"
tokens: 408
---
Important This page documents TinyMCE 7. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../latest/searchreplace/).
# Search and Replace plugin

This plugin adds search/replace dialogs to TinyMCE. It also adds a toolbar button and the menu item `Find and replace` under the `Edit` menu dropdown.

## Basic setup

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'searchreplace',
  toolbar: 'searchreplace'
});
```

## Toolbar buttons

The Search and Replace plugin provides the following toolbar buttons:

| Toolbar button identifier | Description |
| --- | --- |
| `searchreplace` | Searches and/or Replaces contents within the editor. |

These toolbar buttons can be added to the editor using:

- The [`toolbar`](../toolbar-configuration-options/#toolbar) configuration option.
- The [`quickbars_insert_toolbar`](../quickbars/#quickbars_insert_toolbar) configuration option.
- [Custom Context toolbars](../contexttoolbar/).

## Menu items

The Search and Replace plugin provides the following menu items:

| Menu item identifier | [Default Menu Location](../menus-configuration-options/#example-the-tinymce-default-menu-items) | Description |
| --- | --- | --- |
| `searchreplace` | Edit | Opens the search/replace dialog. |

These menu items can be added to the editor using:

- The [`menu`](../menus-configuration-options/#menu) configuration option.
- The [`contextmenu`](../menus-configuration-options/#contextmenu) configuration option.
- [Custom Menu toolbar buttons](../custom-menu-toolbar-button/).

## Commands

The Search and Replace plugin provides the following TinyMCE command.

| Command | Description |
| --- | --- |
| SearchReplace | Opens the search and replace dialog. |

Example
```js
tinymce.activeEditor.execCommand('SearchReplace');
```
