How to get a list of pages that are accessible by anonymous users
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
To get a list of pages that are accessible by anonymous users, from the database.
Environment
Confluence Sites & Spaces with Public Access Enabled
Solution
This query assumes you have anonymous access enabled at the site level and outputs:
Pageswithout restrictions
In spaces allowing anonymous access
ℹ️The following query was written for PostgreSQL
1
2
3
4
5
6
7
8
9
10
11
SELECT c.CONTENTID, c.TITLE, s.SPACEKEY, s.SPACENAME
FROM CONTENT c
LEFT JOIN CONTENT_PERM_SET cps
ON c.CONTENTID = cps.CONTENT_ID
JOIN SPACES s ON s.SPACEID = c.SPACEID
WHERE ((cps.CONTENT_ID is null and c.CONTENTTYPE = 'PAGE' and content_status !='draft') and s.SPACEID IN (SELECT SPACEID
FROM SPACEPERMISSIONS
WHERE PERMTYPE = 'VIEWSPACE'
AND PERMGROUPNAME IS NULL
AND PERMUSERNAME IS NULL
AND PERMALLUSERSSUBJECT IS NULL));
Was this helpful?