How to find a list of pages that contains Content by Label macro and Content by Label is displaying a specific page

プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。

*Fisheye および Crucible は除く

要約

Some labeled pages can be displayed on other pages using the Content By Label macro. For content maintenance or reporting purposes, Confluence administrators may want to find out on which pages the relevant page is displayed using the Content By Label macro. This knowledge base article takes on this task by querying the database using SQL queries

ソリューション

The queries below use wildcard searching in order to locate page content that matches a specific pattern for macros. Due to the nature of wildcard searching, these queries may take a long time to execute, and it is recommended to carry these out in a clone of the production database rather than on the production environment itself to avoid any impact to the production environment.

  1. Use the below query and replace <page_title> with the relevant page's title to get the labels of this page.

    select c.title as page_title, l.name as label_name from content_label cl join content c on cl.contentid = c.contentid join label l on cl.labelid = l.labelid where c.title = '<page_title>' order by title desc;
  2. Run the following query, replacing these labels one by one with the <label_title> to get pages containing the Content by Label macro with the given label used as a CQL filter.

    select s.spacekey, s.spacename, c.title, c.contentid from content c join bodycontent b on c.contentid = b.contentid join spaces s on c.spaceid = s.spaceid where c.contenttype = 'PAGE' and c.content_status = 'current' and c.prevver is NULL and b.body like '%ac:name="contentbylabel%' and b.body like '%label = _quot_<label_title>_quot_%';

関連資料

更新日時: September 25, 2025

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。