Not sure about the global string variable, but below is another method I use to make potentially hundreds of changes in seconds on a big Publii websites.
To replace all instances of the text ‘Project Manager’ with ‘PM’ — both without the quotes.
You can use the free software DB Browser for SQLite. I’m using an Apple Mac.
Naturally, before doing the change below, do keep an unchanged backup copy of your Publii website db.sqlite file — just in case something goes wrong.
Then, close Publii and open the website db.sqlite file you want to change in DB Browser for SQLite.
Choose the ‘Execute SQL’ tab in DB Browser for SQLite.
Then copy and paste the following command into the box:
UPDATE posts SET text = REPLACE(text, 'Project Manager', 'PM')
Choose the ‘Execute all/selected SQL’ button.
Choose the ‘Write Changes’ button.
Exit DB Browser for SQLite.
Open your Publii site again.
Your changes should be made whether your site has 5 pages or 500 pages.
The above takes command takes seconds and beats making changes one by one (hours or days).