Replace Macro in Bulk
The Replace Macro in Bulk feature lets Confluence administrators replace specific macros across multiple pages simultaneously. This is ideal for updating macro parameters or replacing outdated macros in bulk.
1. Configure Scan Conditions
1.1. Select Scan Mode
Choose how the pages should be scanned. Note that some native macros (e.g., info
, warning
) are not searchable via Atlassian’s Search REST API, so they require full-page scanning.
Scan Mode | Description |
---|---|
Search pages | Scans only pages that contain specified macros. Fast, but not compatible with certain native macros. |
Scan all pages | Scans all pages in the selected spaces. Required for macros like |
1.2. Define Macro Settings
Specify the macro to insert, along with its parameters and position.
Field | Description |
---|---|
Old macro name | Name of the macro to be replaced, as shown in View Storage Format. You can find this via More → Advanced Details → View Storage Format on a Confluence page. |
New macro name | Use the macro name as it appears in the storage format. |
New macro parameters |
Input parameters in XML storage format. Example: ✅ Supported Variables: |
New macro rich text | Optional rich text content, supported only by some macros. Example: ✅ Supported Variables: |
Use variables to preserve or adapt original macro data during replacement.
1.3. Import Existing Macro
You can import the configuration from an existing macro on a page to quickly populate the macro fields.
1.4. Define Target Scope
Choose which pages to include in the scan.
Field | Description |
---|---|
Target spaces | The Confluence spaces where the macro will be added. |
Content type | Choose to scan pages, blog posts, or both. |
Filter by labels | (Optional) Include only pages with any of the selected labels. |
2. Run Bulk Operation
2.1. Preview Scan Results
Click Start Scan to preview the list of pages that match your criteria.
2.2. Start Task
Click Replace Macros to run the bulk operation. A background task will be created—you may stay on the page or leave safely while it runs.
3. Best Practices & Tips
Always test in a staging or test space before applying changes to production spaces.
Use Scan All Pages mode when inserting native macros like
info
orwarning
which cannot be found via the Search API.You can find macro name and parameters from storage view of the page via More → Advanced Details → View Storage Format on a Confluence page.
You can mainten a page to contain some frequently used macros. You can use Import Existing Macro to search this page and select an existing macro from this page so that the parameters can be populated automatically into the fields.