I have team site collection inside SharePoint 2013. Where I created a parent sub site inside it. Then under the parent sub site I created many sub sites. Now I need inside the parent sub site's home page to show a list of all the sub sites under it. now this list can be viewed from the "Site content >> Subsites", but i want to display the list in the the parent subsite home page.

I tried the following 2 approaches, but none of them worked:-

  • I added a “Table of Content” web part , under the “content Rollout” Category, but the result is that all the content will be displayed , not only the sub sites, also I can not sort them by created date or show created by ..

  • I added a “content Search” web part , and select “only return site” under the Keyword filter drop down as mentioned on this link ,, but nothing was displayed. here is the result i got:-

enter image description here

i also tried the following Query text, but did not work also. and the ReleventResult is zero as shown below:-

enter image description here

So can anyone advice on this please ?


3 Answers 3


Try to use the following query:

path:"http://tdmgvst01/template" AND contentclass=STS_Web

Or, for the table of contents web part you could set it to only show items below "http://tdmgvst01/template", not to show pages and set the level to show to 2 for sub sites only.

  • Although this works, you should not promote CQWP as it's not part of the Best Practices.
    – Yugo
    Mar 7, 2018 at 16:17
  • @Yugo I don't mention the Content Query Web Part anywhere. Table of Contents webpart is another webpart. Mar 15, 2018 at 7:08
  • Sorry for that I should have added that sadly, ToC webpart is based on CQWP.
    – Yugo
    Mar 15, 2018 at 13:10
  • 1
    @Yugo Ah, I did not know that, never used the table contents webpart as i prefer CSWP. Most of SharePoint OOTB webparts are pretty dull. Mar 15, 2018 at 15:47

I know this is old, but doing a search this is popped up as relevant.

I found the following way to do what you are trying to achieve using CSWP and the following query:

path:{Site} UrlDepth<4 contentclass:STS_Web

If you play with UrlDepth you can show different level of subsites. I hope it helps.


You can use the "Search Results" web part with the Query text contentclass:STS_Web Path:{SiteCollection.URL}

That works for me. I hope it works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.