Chapter 8. Finding and Replacing Text, Tags, and Code

At some point, you’ve probably encountered a find-and-replace tool in a word processing program. As its name implies, the feature 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 offers a richer set of options, too, geared to the world of web-page creation. For example, you can search and replace HTML tags.

Dreamweaver also lets you find and replace text on every page of your site simultaneously, not just in 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 maneuvers are some of the most powerful—and underappreciated—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 Dreamweaver’s “Find and Replace” feature 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—like old archive files. Fortunately, you can hide files from the “Find and Replace” tool using Dreamweaver’s Cloaking feature (see Power Users’ Clinic: Troubleshoot Using ...

Get Dreamweaver CC: The Missing Manual, 2nd Edition 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.