Is there a way to find pages containing references to Unknown macro?

I want to upgrade our Confluence to 4.0. We are using 3.1 currently and have several plugins that are deprecated in 4.0. I've cloned our Confluence instance to a test server and disabled said plugins. Is there a way I can quickly find any page containing "Unknown macro: {whatever}"?

I'm looking for any answer other than "look through every page on the search results for every macro keyword".

5 answers

1 accepted

0 votes
Answer accepted

Using the script provided as an answer to , I was able to identify all pages (hopefully) within all spaces that contained errors.

Hi there Justin, I've recently written this Python script that will connect to a Confluence sever and scan for the kinds of broken content you're describing (including links, images, includes, macros).

If you're comfortable running Python scripts, the script is available on Bitbucket:

Simply run that, and it will generate a HTML report listing all the pages with broken content.

Not sure the macro regex is identifying broken pages appropriately. I get errors, but only on the first "<title>Log In" test. I specifically tested the script on a space that I know has broken macros and it does not identify this in the report.

Does this examine the source HTML for all pages within a space? If so, "Unknown macro" isn't present in page source, but rather it's a wysiwyg-unknown-macro img class. However, replacing this html source into your script still does not return any hits.

Not sure where the wysiwyg class came from or went, but I just reloaded the page and the div class="error" is now present as well as "Unknown macro". I still did not get anything in the report about these pages though using the version on bitbucket.

Hi there Justin,

This script is written for Confluence 4.0, if you are seeing "login errors", then either the password for the username is not correct or perhaps the username does not have permissions to view the page where the error occurs.

We are testing the script against Confluence 4.0, the errors you are seeing might be specific migration artifacts. There may be more cases of macro errors that we could add to the script.

Can you give me an example of the error text you are seeing in the page, that should be detected?


I figured out what the issue was. First, i'm running HTTPS, so that may be the root of why the script wasn't working from the get-go. In order to bypass that issue, I used Gavin Fowler's code from the Question above as a starting point.

My call on line 192 now looks like:

pageId= page_summary['id']
html = downloadpage(site_address,s,token,conf_space,pageId)

Obviously this warrants a change to the downloadpage definition to accept these inputs. Within that function, line 133 becomes:

html = s.renderContent(token,conf_space,pageId,'',{'style':'clean'})

which was taken directly from Gavin's solution linked above in my "Accepted Answer". Running with these changes now produces the correct behavior: Log In error is gone, Macro Error is found.

Hi again Justin, thanks for providing some troubleshooting on this script!

Please let me know if there's anything else I can help you with.

Hi Sirs,

I know it's kind of late but is there any plan on compatibility with Confluence 5.x ?


How to test a Confluence instance for macro errors - I have been meaning to write this up for some time, your question motivated me to do it :). We are also doing a major upgrade (to 3.5.13) soon and this problem is always a significant concern.

That's gone now. Atlassian has helpfully trashed it.

0 votes
Joe Clark Atlassian Team Oct 20, 2011

I think we've found someone with a solution for you - I've asked them to give you an answer here.

This is actually a question. Does the python script from Bitbucket still work? When I try to run it, I get an error on line 125 where it tries to use XML-RPC to retrieve a list of all pages in the space. The error says, "unsupported XML-RPC protocol" I checked around and discovered that XML-RPC has be deprecated since 5.5, and I'm using 5.9.3. Does this part of the script need to be rewritten to use REST API? Any suggestions on how to do that? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

984 views 2 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you