Occasionally, something comes up that requires a change to all pages on the site that contain some specific text. We use the Confluence Command Line Interface (CLI) to automate that. This is based on How to globally search and modify content.
Incompatible change to TOC macro
The TOC macro used to allow as a forced blank in the separator field. We used this to space out the TOC better. All of these had to be changed. Here is what was used. Only pages that had the actual text were actually changed.
--action runFromPageList --space @all --common "--action modifyPage --id @pageId@ --findReplace \"' &nbsp;|&nbsp; ':pipe\" --minor "