Edit multiple pages with find and replace

The Find and Replace dialog box enables you to locate and replace text or code in one or more web pages, or a whole site. You can locate a single instance of text at a time or locate all instances at the same time. You can search for text in the code of a page by using any of the tabs in the dialog box. For more information about using the HTML Tags tab to search code, see Find and replace tags.

Tip

To quickly locate characters in an open document, use the Incremental Search command on the Edit menu instead of the Find and Replace dialog box. See Incrementally search a page.

Options and rules that you set can restrict the results to those that meet the criteria that you specify. For example, you can specify which pages and what direction you want to search, and also how you want to search for text or code in those pages. In addition to searching for instances of specific text or code, you can search for a pattern of text or code by using regular expressions or HTML rules.

Note

For ASP.NET and other mixed-content sites, results are returned only for the master page. Check the Find in source code box for ASP.NET and other mixed-content sites to find text in all pages.

Tip

If you frequently perform the same search, you can save it as a query. The next time that you want to perform that search, you can open the query, instead of entering the search criteria again. You can create new queries, or open previously created queries, by using the Query options found on all the tabs in the Find and Replace dialog box.

To find text in one or more pages

  1. Do one of the following:

    • To search within a single page, open the page.

    • To search all pages in a site, open the site.

    • To search in one or more pages in a site, in either the Folder List panel or the Site View, select the pages that you want to search.

    • To search in one or more pages in a site, open the pages that you want to search.

  2. On the Edit menu, do one of the following:

    • To find but not replace text, click Find.

    • To find and replace text, click Replace.

  3. In the Find and Replace dialog box, on either the Find or Replace tab, do the following:

    Use this To do this

    Find what

    Type the text you want to search for.

    HTML Rules

    To only find text that meet certain HTML criteria that you specify, set the rules that you want. For more information, see Set HTML rules for finding text.

    Find where

    Select the option that represents the pages that you want to search.

    Display results in

    Select the panel you want to show the results in.

    Direction

    If you are searching in only the current page, select the direction in which to search.

    Match case

    Find text only if it matches the case of the text you typed.

    Find whole word only

    Find text only if it matches a whole word.

    Ignore whitespace differences

    Ignore the spaces and tabs between words and treat them each as a single white space. This option isn't available if the Regular expressions check box is selected.

    Regular expressions

    To use regular expressions, do one of the following:

    • Click Regular Expressions Cc295232.48d27529-a669-464e-9bd3-e5887762c48a(en-us,Expression.40).gif next to the Find what box, and select an expression.

    • To select an expression you've recently used, click Most recently used Cc295232.ea99c9f1-bc53-49f2-bcef-056b5ab11726(en-us,Expression.40).gif and select an expression.

    For more information, see Regular expressions for finding text.

    Find in source code

    Find text in the HTML code. For example, you can search for text that is not visible or editable in the page, such as the page title you set in page properties.

  4. Do one of the following:

    • To find one instance at a time when you're searching a single page, click Find Next. The next instance is selected in the page in both Design view and Code view.

    • To find all instances at the same time when you're searching a single page, click Find All. The search results appear in the Find panel.

    • If you're searching multiple pages or all pages in a site, click Find All. The search results appear in the Find panel.

  5. Do one of the following:

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

    • If you clicked Find All, to open and then locate the instance in the page, either double-click a row or right-click a row in the Find panel, and then click Go to Page Cc295232.18f213fe-3e08-4e2a-8636-77f8ad816a39(en-us,Expression.40).gif. To replace the current instance, in the Find panel, click Find and Replace Cc295232.23b521d0-8b72-43d3-ab83-5e74086afeed(en-us,Expression.40).bmp 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 with which you want to replace the found text, and then click either Replace to replace a single instance or Replace All to replace all occurrences of the text.

See also

Tasks

Incrementally search a page
Find and replace tags
Set HTML rules for finding text
Use the thesaurus
Select text
Select code

Concepts

Regular expressions for finding text

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