Find & replace
Use the find and replace feature to search your website for words or phrases and, optionally, replace them with another word or phrase. This feature is useful when you want to:
- Identify pages on your site containing a word or phrase so you can edit the relevant pages manually.
- Replace a short phrase with another – for example, when a module name changes.
- Replace instances of an old, broken URL with the correct URL.
Find and replace is limited to a maximum of 5,000 pages at a time.
In this article:
Find and replace in a single page
-
Browse to the page where you need to find or replace content.
-
Go to Edit > Edit centre content:
-
Select the Find and replace button or place your cursor in the page and use the keyboard shortcut Ctrl+F.
Note: This function can not find and replace text or other content contained in Custom HTML components.
-
The Find and replace pop-up appears:
-
Enter a word or phrase in the Find box.
-
Optionally, enter the text you want to replace it with in the Replace with box.
Important: If you only want to search for words or phrases, leave the Replace with box empty.
-
Select the Preferences button to open the search preferences. Here, you can choose whether to:
-
Match case: Search only for places where the text has the same capitalisation.
-
Match whole words only: Only look for places where your text is the entire word or phrase. For example, searching for a short word like 'it' without Match whole words only enabled will also return words containing 'it', like 'edit' or 'with'.
-
Find in selection: Only search within a section of text you've highlighted on the page.
-
- Select the appropriate button:
-
Find – Highlight any instances of the word or phrase in the current page. You can also cycle through each instance in turn using the up and down buttons.
-
Replace – Replace the currently-selected instance of the matching word or phrase.
-
Replace all – Replace all instances of the matching word or phrase.
-
-
When you've finished, close the Find and replace window by selecting the Close button.
Find and replace in a website or section
-
Go to the topmost page of the section where you want to find and replace, then select Edit > More:
-
On the Current page tab, select Find and replace:
-
You see the Find and replace screen:
-
In the Find box, enter the word or phrase you want to find. You can optionally choose to make the search Case sensitive or Match whole phrase.
Note: by default, any word in Find is matched. It's a regular text search, not Boolean. For example, if you enter modules AND 2007, and leave Match whole phrase unselected, SiteBuilder returns matches for any of the three words modules AND 2007 – not pages containing both modules and 2007.
-
If you want to replace the matching text, enter the replacement word or phrase in the Replace with box.
Note: You don't need to specify text in Replace with when you only want to perform a ‘find’ operation. This will also allow you to simply remove matching text in the following steps, i.e., replace it with nothing.
-
Choose the scope of the find and replace operation from the Pages to search drop-down list:
-
Current page and all sub-pages (default)
-
Current page and all sub-pages in the same site
-
Current page only
-
-
Specify how the find and replace operation applies to your pages by selecting the relevant radio button:
-
Apply changes only to the content of the pages - changes will apply only to the text content of the page(s).
-
Apply changes to the content and the page properties of the pages – changes will apply to page content, plus any matching text in the page heading, link caption, title bar caption, description and keywords in page properties.
-
-
By default the find and replace operation applies solely to text in a page. For example, the link caption text is matched, but its target URL is not. To include non-visible text in the find and replace (including alt text), select Include image, link and embedded media descriptions and URLs.
-
Optionally, expand the Advanced options:
-
Use regular expressions: This is intended for those familiar with regular expressions; use with care.
-
Match raw HTML: Find and replace in the raw HTML without any of the restrictions mentioned in steps 7 & 8 above. When you select Match raw HTML, the option to Include image, link and embedded media descriptions and URLs is disabled.
Caution: changing HTML can cause a page to display incorrectly.
-
-
Select Find.
-
SiteBuilder displays a list of the pages in the site or section, with options to show matches and preview changes for pages with matching results:
-
If the list is too long, you can Hide pages with no matches.
-
To see the occurrences of matching text, select the Show n matches button for the relevant page.
-
Select Preview replacement to see how a page would look if you continue to replace the matching text (or Preview removal if you did not specify any replacement text).
-
-
Review the matches. When you have finished previewing how the pages will change, do one of the following:
-
Perform the replace operation by selecting Replace matches (or Remove matches, if you did not specify any replacement text).
-
Go back and edit your find and replace options by selecting Edit search.
Caution: be sure that you're happy with the preview before you proceed and replace the matches. It's not possible to undo the replace in a single operation; it requires visiting each page to restore the previous version via the page history.
-