Find and replace tags

The Find and Replace dialog box enables you to locate a specified tag in one or more web pages or in all pages in your site. You can specify the direction to look in the page, and set basic or advanced search criteria.

When tags are found, you can replace or delete the tag and its content, replace only the content, add content after or before the tag, or set an attribute.

Tip

You can use the Code View toolbar or Code View submenu on the Edit menu to quickly locate the end tag or curly brace (}) for a start tag or vice versa. For more information, see Select code. You can use the Apply Styles panel to locate every application of a particular style in a web page. For more information, see Apply Styles panel.

To find and replace HTML tags in a single page

  1. On the Edit menu, click either Find or Replace.

  2. In the Find and Replace dialog box, on the HTML Tags tab, do the following:

    Use this To do this

    Find tag

    Type or select the tag you want to find.

    NoteNote
    If additional options appear to the right of the Find tag box, type or select options that further define how you want to replace the tags.

    Replace action

    Click the action you want.

    NoteNote
    If additional options appear to the right of the Replace action box, type or select options that further define how you want to replace the tags.

    HTML Rules

    If you want to find only tags that meet certain criteria that you specify, set the rules you want in the HTML Rules dialog box. For more information, see Set HTML rules for finding text.

    Search options

    Click the options that you want.

  3. Do one of the following:

    • To find one instance at a time, click Find Next.

      The next instance is selected in the page in both Design view and Code view.

    • To find all instances all at once, click Find All.

      The search results appear in the Find panel.

  4. Do one of the following:

    • To go to the next instance, in the Find and Replace dialog box, click Find Next.

    • If you clicked Find All, in the Find panel, to open and then go to the instance in the page, either double-click a row or right-click a row and click Go to Page Cc295337.7102836d-528e-4f55-a5d1-4f14e987e200(en-us,Expression.40).png. To replace the current instance, in the Find panel, click Find and Replace Cc295337.46327336-4b09-413d-bc3d-a4ffcf1f1938(en-us,Expression.40).png to open the Find and Replace dialog box.

    • To replace the text, in the Find and Replace dialog box, in the Replace tab, in the Replace with box, type the text you want to replace the found text, and then do one of the following:

      To replace the current instance, in the Replace tab, click Replace.

      To replace all occurrences of the text, in the Replace tab, click Replace All.

To find and replace HTML tags in multiple pages

  1. Do one of the following:

    • Open the pages that you want to search.

    • In the Folder List panel or the Site View window, select the pages that you want to search.

    • Open the site you want to search.

  2. On the Edit menu, click either Find or Replace.

  3. In the Find and Replace dialog box, on the HTML Tags tab, do the following:

    Use this To do this

    Find tag

    Type or select the tag you want to find.

    NoteNote
     If additional options appear to the right of the Find tag box, type or select options that further define how you want to replace the tags.

    Replace action

    Click the action you want.

    NoteNote
     If additional options appear to the right of the Replace action box, type or select options that further define how you want to replace the tags.

    HTML Rules

    If you want to find only tags that meet certain criteria that you specify, set the rules you want in the HTML Rules dialog box. For more information, see Set HTML rules for finding text.

    Search options

    Click the options that you want.

  4. Click Find All.

    The search results appear in the Find panel.

  5. Do one of the following:

    • To go to the next instance, in the Find and Replace dialog box click Find Next.

    • To open and then go to the instance in the page, in the Find panel, either double-click a row or right-click a row and click Go to Page.

    • To replace the current instance of the text, in the Find and Replace dialog box, in the Replace tab, in the Replace with box, type the text you want to replace the found text, and then click Replace.

    • To replace all instances of the text, in the Find and Replace dialog box, in the Replace tab, in the Replace with box, type the text you want to replace the found text, and then click Replace All.

See also

Tasks

Edit multiple pages with find and replace
Set HTML rules for finding text
Use the thesaurus
Go to a specific line of code
Go to a hyperlink or bookmark (HTML anchor)

Concepts

Regular expressions for finding text

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.