Skip to content

Instantly share code, notes, and snippets.

@AaronSadlerUK
Created February 4, 2026 19:29
Show Gist options
  • Select an option

  • Save AaronSadlerUK/f2bb83ccaf0b23840f6c06b45e536de1 to your computer and use it in GitHub Desktop.

Select an option

Save AaronSadlerUK/f2bb83ccaf0b23840f6c06b45e536de1 to your computer and use it in GitHub Desktop.
Find Umbraco Macro usage
-- Find PUBLISHED content with macros in Umbraco 13
SELECT DISTINCT
n.text AS 'Content Name',
n.id AS 'Node ID',
pt.Alias AS 'Property Alias',
SUBSTRING(pd.textValue, 1, 500) AS 'Preview'
FROM umbracoPropertyData pd
INNER JOIN umbracoContentVersion cv ON pd.versionId = cv.id
INNER JOIN umbracoDocumentVersion dv ON cv.id = dv.id AND dv.published = 1
INNER JOIN umbracoNode n ON cv.nodeId = n.id
INNER JOIN cmsPropertyType pt ON pd.propertyTypeId = pt.id
WHERE pd.textValue LIKE '%<?UMBRACO_MACRO%'
OR pd.textValue LIKE '%umb://macro/%'
OR pd.textValue LIKE '%"macroAlias"%'
ORDER BY n.text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment