Using Search & Replace in Pressbooks

Why use the Pressbooks search & replace tool?

  • To locate/identify specific content within the book sections
  • To replace a common phrase or word throughout the entire book
  • To replace characters or symbols throughout the book
  • To replace some HTML code (use with caution)

Before you begin…

The Search & replace tool within Pressbooks is not feature rich. Use with caution and be sure to carefully examine the Preview changes option. When attempting to update HTML code, Pressbooks will often overwrite the changes you are attempting to make and seek to close the HTML tag, which will render your change ineffective at best (or introduce problems). There are two useful ways to use Search & replace.

Using Search & Replace to locate content within the book

Search and replace tool in Pressbooks has the option to search (without replacing)
Image source: Search & Replace tool – eCampus Ontario’s Pressbooks. © Pressbooks.

 

  • Use Search & Replace as a search tool to locate content areas that need updating, specific details that need to be verified or updated, etc
  • Enter your search term and click Search – do not use the replace button
  • Right click and open pages that appear in the results in a new tab to avoid losing your place
  • If manually replacing something, you can re-run the search tool as you correct specific pages, to see what is left.

Using Search & Replace to replace text, code & more

  • Do not attempt to replace complete HTML tags using Search & replace, as Pressbooks will overwrite the output
  • Check Preview replacements carefully – note the closing tags added in screenshot below:
Pressbooks search and replace overwrites the code and tries to close the tag if you include brackets when searching
Image source: eCampus Ontario Pressbooks Search & replace tool. Note that Pressbooks has added closing tags to the text to be replaced. © Pressbooks.
  • You can replace text within an HTML tag successfully (don’t actually do this with figcaption, it has a purpose)
  • Check the Preview replacements carefully to ensure you’re getting the change you require
  • If in doubt, don’t replace & save
  • More complicated tagging changes should be done in Dreamweaver
Search and replace in Pressbooks will allow you to find and replace HTML tags if you don't include the brackets.
Image source: eCampus Ontario Pressbooks Search & replace tool. Search for HTML tags without the brackets and check the preview to ensure code won’t be overwritten.

 

Attribution & References

Except where otherwise noted, “Using Search & Replace in Pressbooks” by Jen Booth is licensed under CC BY-NC 4.0.

  • Screenshots of eCampus Ontario’s Pressbooks instance with the Search & Replace tool are shared under Fair Dealing (Canada) for educational purposes.

Media Attributions

License

Share This Book