How to Extract URLs from an XML Sitemap Using PowerShell
To extract URLs from an XML sitemap using PowerShell, cast the file to [xml] and read the loc element of every url entry: That returns every URL as plain text. Below I filter them by keyword, remove duplicates, handle sitemap index files, and save the list. I tested each step in PowerShell 7 and Windows … Read more