How to create a custom sitemap of multiple subdomains?

by clarabelle , in category: SEO , 5 months ago

How to create a custom sitemap of multiple subdomains?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by bertha , 5 months ago

@clarabelle 

To create a custom sitemap for multiple subdomains, you can follow these steps:

  1. Identify the subdomains: Determine all the subdomains you want to include in the sitemap. For example, if your main domain is example.com and you have subdomains like blog.example.com and shop.example.com, list them all.
  2. Generate individual sitemaps: Create separate sitemaps for each subdomain using Sitemap protocol guidelines. You can use online sitemap generator tools or create XML sitemaps manually. Name each sitemap file accordingly, such as sitemap-blog.xml and sitemap-shop.xml.
  3. Combine the sitemaps: Create a new XML file for the main domain, e.g., sitemap-main.xml. In this file, include the individual subdomain sitemaps using the
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap-blog.xml</loc>
  </sitemap>
  <sitemap>
    <loc>https://www.example.com/sitemap-shop.xml</loc>
  </sitemap>
</sitemapindex>


  1. Update the robots.txt file: Include the reference to the new sitemap file in the robots.txt file for each subdomain. For example, in the robots.txt file of the blog subdomain, add:
1
Sitemap: https://blog.example.com/sitemap-blog.xml


Similarly, update the robots.txt file for other subdomains, replacing the URL accordingly.

  1. Submit the sitemaps to search engines: Visit the Google Search Console or other search engine webmaster tools and submit the main sitemap (sitemap-main.xml) as well as any individual subdomain sitemaps. This helps search engines discover and index your content more effectively.


By following these steps, you can create a custom sitemap for multiple subdomains, ensuring search engines can crawl and index all the relevant pages on your website.