In sharepoint 2013, we have native support for generating xml sitemaps which was not present in the earlier versions of sharepoint. Sitemaps basically inform the search engines about the pages and their metadata, present in your site. This help the crawlers in picking up those pages. This is a great feature especially for public facing websites.
The steps to generate sitemap are straightforward but nowhere I found complete documentation on it. So to begin with, there are three prerequisites for generating sitemap:
- This feature is available for publishing sites only.
- Anonymous access should be enabled for both web application and site collection.
- Search should be configured in the environment.
The step by step procedure to generate sitemap is:
- Enable anonymous access for web application.
For this go to “Central Admin” -> “Manage Web Applications” . Select your web application and click on “Authentication Providers” in top ribbon.
Click on the zone. There you will get the option to enable anonymous access.
- Enable anonymous access for site collection.
Go to “Site Settings” -> “Site permissions”. Click on “Anonymous Access” in the top ribbon and select “Entire Web site”. Click “OK”
- Activate “Search Engine Sitemap” feature of site collection. This registers a timer job “Search Engine Sitemap Job” for generating sitemap. This job by default runs daily.
- As sitemap generation uses Search Service to generate sitemap; run full crawl or incremental crawl as applicable to your environment.
Go to “Central Admin” -> “Application Management” -> “Manage service applications” -> “Search Service”.
Then click on “Content Sources” and run full/incremental crawl for your content source.
- For getting instantaneous result, run the timer job mentioned in step 4 for your web application manually.
- And we are done.
The sitemap is located at the root level site collection. The url to access the sitemap is http://<WebApp>/sites/<SiteColl>/sitemap.xml. This file contains the location of actual sitemap and that is http://<WebApp>/sites/<SiteColl>/sitemap0.xml. The content of the sitemap file is like:
Hope this helps.