Exclude multiple headings in table of contents

Addie Hutchins January 7, 2022

I have multiple headings I'd like to now show up in the table of contents. 

I can get it to not show one of them, but I don't know how to add multiple. 

I saw somewhere online to put this:   (|)

but should there be a space between the heading title and that symbol or after or not at all? 

 

For example I have two headings called "purpose" and "Jump to" - Purpose excluded is working but how do I add "jump to" to also be excluded? 

purpose(|)jump to   ?

Thanks :) 

3 answers

3 votes
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2022

Hello @Addie Hutchins  yes, in the macro settings, there is exclude headings. The docs say:

Filter headings to exclude according to specific criteria. You can use wildcard characters.

If the headings you want to exclude areOverviewandSummary, enterOverview|Summaryin this field.

Full documentation is here https://support.atlassian.com/confluence-cloud/docs/insert-the-table-of-contents-macro/ 

Ryan Canfield September 14, 2022

For the example provided in the documentation, any headline with the word "Overview" in it is excluded. Headings with the text "Overview", "Overview of Work", "Executive Overview", "My Overview is the Best Overview" are all excluded.

The correct regex to use to match only "Overview" or "Summary" headings is:

^Overview$|^Summary$

^ is beginning of string. $ is end of string.

Note: TOC does not use any newline characters

Note: The Preview pane is not accurate.

Like # people like this
Steph Carter October 4, 2022

The Preview Pane is displaying the accurate things for me once I got the format right :) 

Mads Trier June 12, 2023

@Ryan Canfield thank you! Works for me! Spent ages and couldn't figure out what was wrong.

0 votes
James Knight January 9, 2024

image.png

I can write RegEx in a heartbeat, if I know that I need to write RegEx! I think the in-app hint is very misleading...

Enter one or more expressions, separated by commas, to filter out certain headings

0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2022

Hi @Addie Hutchins 

No Space is best practice even though space works!!

and case sensitive!!

Thanks,
Pramodh

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events