How to run a Python script that used XML/RPC to find those macros, remove them, and save the pages.
Here's a program that is pretty close to what you need. Your wiki needs to be open to XML/RPC access, you need to put in credentials and the right URL, and you need to put in the text you need to remove. If what you want to remove a macro that varies because of different parameters, you'll need to use re (the Python regex module) rather than doing a string replace.
Note that this acts on the storage format – to see what your macro looks like in storage format, choose Tools > View Storage Format when looking at a page that has the macro.
If you want to go through the entire wiki, you can get the space list using the XML/RPC method "getSpaces" and add an additional for loop to go through the spaces.
#!/usr/bin/python
#
import re,sys
from xmlrpclib import Server
space='Linux'
comment={'versionComment':"Page put into format by script."}
# main program
# Set up confluence
s=Server("http://serverbaseurl/rpc/xmlrpc")
token=s.confluence2.login("username","password")
pages=s.confluence2.getPages(token,space)
for pagesum in pages:
pagename=pagesum['title']
try:
page=s.confluence2.getPage(token,space,pagename)
print "Doing page",pagename.encode('utf8','replace')
except:
print "Couldn't read page",pagename
continue
page['content']=model['content'].replace('remove','')
page=s.confluence2.updatePage(token,page,comment)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.