---
title: "How to automate adding text to Confluence pages"
canonical: "https://support.appfire.com/space/SUPPORT/89147805/How%20to%20automate%20adding%20text%20to%20Confluence%20pages"
format: markdown
---
# Description

This describes how to add some standard text to the beginning or end of a bunch of Confluence pages. This assumes you have access to the Confluence database for running a read-only query to select the pages that you are interested in updating.

> ✅ **Test carefully**
> ✅ 
> ✅ Test on a few pages first to make sure the result is what you want!

# Steps

1. Construct a SQL query that selects the pages you are interested in. Test against your database.
2. Figure out the **runFromSql** parameters for accessing your database.
3. Put it all together in a single command:

> ✅ **Use find and replace support to modify existing content**
> ✅ 
> ✅ **--findReplace** and/or **--findReplaceRegex** can be used to modify the contents with or without adding additional content. Watch out for unintended substitutions - choose your find string/regex carefully.
> ✅ 
> ✅ ##### **Example**
> ✅ 
> ✅ ```
> ✅ --action modifyPage --id 12345678 --findReplace "xxx:yyy"
> ✅ ```


> ✅ **Alternatives**
> ✅ 
> ✅ [runFromPageList](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-runFromPageList) and [runFromList](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-runFromList) or similar can also be used to accomplish similar things without SQL