How to export a list of all URLs on the site | Community
Skip to main content
January 19, 2023
Solved

How to export a list of all URLs on the site

  • January 19, 2023
  • 3 replies
  • 5871 views

Hi everyone, I'm wondering: is there a way to do a "URL dump" of all the pages on our site? I've tried the "Create CSV Export" feature, but it's only giving me the page paths -- not something I can share with stakeholders. 

Would love some help if this is something that's actually possible. I've tried Googling and searching here and haven't had any luck.

I don't know whether this is relevant, but I only have authoring/publishing access.

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nitin_laad

Hi @msvibey you can give a try to groovy script for this - sample code 

 

import com.day.cq.wcm.api.Page; import com.day.cq.wcm.api.PageManager; def pageManager = resourceResolver.adaptTo(PageManager); def siteaPage = pageManager.getPage("/content/sitea"); def pages = siteaPage.listChildren(); for(def page : pages) { println page.getPath()+".html"; //or println "domainName" + page.getPath()+".html"; }

 

3 replies

Avinash_Gupta_
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 19, 2023

Hi @msvibey 

 

You can use OOB create CSV report feature available on sites to generate the list of pages on your website. Kindly refer to the below link:-

 

https://experienceleague.adobe.com/docs/experience-manager-65/authoring/authoring/csv-export.html?lang=en 

 

Hope this helps.

MsVibeyAuthor
January 19, 2023

Thanks so much, @avinash_gupta_ I have tried that, but just get the path rather than the full URL. Not sure how to get the URL unless I find a formula for Excel that will allow me to change the path in the CSV file to a URL. Which might be an option - I'll check it out.

 

 

Himanshu_Jain
Community Advisor
Community Advisor
January 19, 2023

From Author that will be the only way , you need to append domain name to construct the full url.

 

Himanshu Jain
Manu_Mathew_
Community Advisor
Community Advisor
January 19, 2023

@msvibey You probably can use query builder queries or so to get the info. you want and export the same too if you wish to customize it based on your need. You could also try groovy scripting.

Nitin_laad
Community Advisor
Nitin_laadCommunity AdvisorAccepted solution
Community Advisor
January 20, 2023

Hi @msvibey you can give a try to groovy script for this - sample code 

 

import com.day.cq.wcm.api.Page; import com.day.cq.wcm.api.PageManager; def pageManager = resourceResolver.adaptTo(PageManager); def siteaPage = pageManager.getPage("/content/sitea"); def pages = siteaPage.listChildren(); for(def page : pages) { println page.getPath()+".html"; //or println "domainName" + page.getPath()+".html"; }

 

MsVibeyAuthor
January 23, 2023

Thank you both so much. I've saved off this script for someone in the digi team who might be able to do it, but it's beyond me, I'm afraid. I'm a content manager with author/publisher access only, so it's several bridges too far. 😄