All Orphan Tag Wikis & Excerpts

1

Please login or register to vote for this query.

(click on this box to dismiss)

Pulls a list of all (non-empty) orphaned tag wiki-excerpt pairs. Tag wikis are orphaned when their parent tag is removed or synonymized. No tag name is associated with these wikis anymore, since the tag itself was removed; this makes them difficult to catalogue, as no tag name is associated with them in SEDE.

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

SELECT
  CASE WHEN excerpt.Id IS NOT NULL
    THEN CONCAT('site://posts/', excerpt.Id, '/revisions|Excerpt Link') 
    ELSE 'N/A'
  END AS [Exrpt. Link],
  CASE WHEN excerpt.Body IS NOT NULL
    THEN excerpt.Body 
    ELSE '[This excerpt does not exist]'
  END AS [Exrpt. Body],
  CONCAT('site://posts/', wiki.Id, '/revisions|Wiki Link') AS [Wiki Link],
  wiki.Body AS [Wiki Body],
  wiki.CreationDate AS [Wiki Creation Date]
FROM Posts wiki
LEFT JOIN Posts excerpt ON excerpt.Id = (wiki.Id + 1) AND excerpt.PostTypeId = 4
LEFT JOIN Tags t ON t.WikiPostId = wiki.Id
WHERE wiki.PostTypeId = 5   -- Limit posts to tag wikis only.
  AND t.Id IS NULL          -- Only pull wikis where no tag is associated.
  AND (wiki.Body <> ''      -- Omit wiki/ excerpt pairs where both are empty,
    OR excerpt.Body <> ''   -- since there's nothing to read.
  )
ORDER BY wiki.CreationDate

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results