How to get a list of pages that are accessible by anonymous users

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

Solution

This query assumes you have anonymous access enabled at the site level and outputs:

  1. Pages without restrictions
  2. In spaces allowing anonymous access

(info) The following query was written for PostgreSQL

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));






Last modified on Aug 26, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.