Skip to content

How to Fix Confluence Expand Macro Not Working

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Confluence Expand Macro Not Working. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.

The Confluence expand macro shows a gray box with no toggle, content is hidden but cannot be expanded, or the macro does not render. Storage format issues cause this.

The Wrong Way

// Nesting expand macros inside each other
[expand]
  [expand]
    [expand]deep content[/expand]
  [/expand]
[/expand]

Nested expand macros break Confluence's parser. The inner macros do not render.

The Right Way

Step 1: Use the expand macro correctly

# In the editor: /expand → select "Expand" macro
# Give it a title: "View Details"
# Add content inside the expand body

Step 2: Check the macro body

# View → Storage Format
# Valid expand macro:
# <ac:structured-macro ac:name="expand">
#   <ac:parameter ac:name="title">Click to expand</ac:parameter>
#   <ac:rich-text-body>
#     <p>Hidden content here</p>
#   </ac:rich-text-body>
# </ac:structured-macro>

If the storage format has unclosed tags or missing body, the macro breaks.

Step 3: Remove nested expands

# Confluence does not support expand-inside-expand
# Workaround: use a single expand with headings inside
# Or use the "Details" summary macro for sub-sections

Step 4: Clear cache and retry

# Confluence Admin → Cache Management → Flush cache
# Or add a space at the end of the content and save again
# Sometimes trailing whitespace triggers re-render
Expand macro "Implementation Details" toggles correctly — 3 paragraphs hidden, reveal on click.

Prevention

  • Do not nest expand macros — use a single expand with headings for structure.
  • Keep expand titles short (under 50 characters) for the toggle button to display fully.
  • The toggle pattern is the same as Doda Browser's collapsible developer toolbar — clean toggling without nested conflicts.

Common Mistakes with expand macro

  1. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  2. Using head and tail instead of pattern matching, causing runtime errors on empty lists
  3. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks

These mistakes appear frequently in real-world CONFLUENCE code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why is my expand macro not showing the toggle?

The storage format may be corrupted. Remove the macro and re-add it from the toolbar. If that fails, check View → Storage Format for missing <ac:rich-text-body> tags.

Can I set the expand macro to be open by default?

Not in Confluence Cloud. The expand macro always starts collapsed. Some third-party plugins provide a "start expanded" option. In Data Center, you can customize the macro with CSS or JavaScript.

Yes. Content inside expand macros is indexed by Confluence search. Users can search for text inside expanded sections and find the page. The expand only hides content visually, not from search engines.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro