Chapter 8. Find and Replace

You’ve probably encountered find-and-replace tools in word processing programs. As its name implies, the command finds a piece of text (“webmaster,” for example) and replaces it with another piece of text (“webmistress”). Like Microsoft Word, Dreamweaver can search and replace text in the body of your web pages, but it also offers options that enhance your ability to search-and-replace within the tag-based world of HTML.

Dreamweaver lets you find and replace text on every page of your site simultaneously, not just the current, open document. In addition, you can remove every appearance of a particular HTML tag, or search and replace text that matches very specific criteria. For example, you can find every instance of the word “Aardvark” that appears within a paragraph styled with the class name animal. These advanced find-and-replace maneuvers are some of the most powerful—and under-appreciated—tools in Dreamweaver. If you learn how to use them, you can make changes to your pages in a fraction of the time it would take otherwise.

Tip

You can use Find and Replace to search an entire site’s worth of files. This is powerful, but it can also be slow, especially if some folders hold files you don’t want to search—old archive files, for example. Fortunately, you can hide files from Find and Replace using Dreamweaver’s Cloaking feature (see Cloaking Files for details).

Find and Replace Basics

To start a search, press Ctrl+F (⌘-F), or choose Edit→Find and Replace. ...

Get Dreamweaver CC: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.