What is sitemap.xml?
Sitemap.xml is a kind of XML file that contains some URLs and related information wrapped with XML tag. Sitemap is used by search engine bots only. It provides information and an invitation to search engines to crawl those pages and index. In this post, we will introduce you with different types of sitemap but we will discuss only details regarding Sitemap.xml. This file has a great effect on On-Page SEO. A new web site can be indexed easily within the shortest possible time using this file because it helps a lot to direct search engine crawlers find and index pages.
Introduction to various types of sitemap.xml files:
There are several types of sitemap we can use for getting better optimization results, such as:
- HTML sitemap: It is an HTML page that includes several anchor texts displayed in the outline and is linked to the page it references. It is designed for the visitors, known as a human-readable sitemap that is used for an easier navigation process. Visitors can go there to find the pages they are looking for on the website.
- Text sitemap: This sitemap is simply a text file. It contains All the URLs of a website. It was used by yahoo before the XML sitemap format was discovered. Now it is not used anymore, but you can get all the URLs of your site in one place by using this file.
- XML sitemap: This is the one we are going to discuss in detail.
- Image sitemap: It includes all the image URLs of a website and it helps search engines to identify images of your site and index them. That is why visitors can find your images using the search engine image search facility.
- Video sitemap: It includes all the URLs of video files of a website.
- News sitemap: Giant search engine Google also provides news services. If you want to share news with this site then you need to create a separate sitemap containing URLs that are shared with news services to index those pages.
- Mobile sitemap: Nowadays the number of mobile internet users is huge so many webmasters are using an additional mobile version of their site. In this case, they may create a sitemap using mobile useable content URL only. It helps search engines to provide the best search results for mobile devices.
NB: If you can understand the creation and usage of XML sitemap then all other types of sitemap creation and usage will be a lot easier for you. So let’s see.
How to create a sitemap.xml file?
To create it manually for your website based on the Sitemap protocol, you need to do the following tasks:
1. Create a text file using notepad or Dreamweaver or a text editor of your choice and save it with a .xml extension. The best name would be sitemap.xml.
2. Add the following code at the top of the file: Here you must use the 1st 2 lines as default. Second line starts with <urlset> tag that will be closed with <urlset> closing tag in the last stage of this file. You must write all the URLs that you are going to submit using this sitemap between these <urlset> and <urlset/> tag.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3. Now write the following code just bellow the mentioned 2 lines:
<url> <loc>http://www.leadaleader.com</loc> <lastmod>2013-05-12</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> <url> <loc>http://www.leadaleader.com/blog/</loc> <lastmod>2013-05-12</lastmod> <changefreq>daily</changefreq> <priority>0.8</priority> </url>
- Here <url> is the starting tag of a particular URL and other data needed for the sitemap creation process and </url> is the closing tag.
- <loc> tag contains a particular URL of your site and </loc> is the closing tag.
- <lastmod> tag contains the period date when this page was last modified. You can define a date as you want, but the current date is recommended. It helps search engines to identify that this particular page needs to be crawled again or not. And </lastmod> is the closing tag.
- <changefreq> indicates how often your page content may be changed. You can use daily, weekly, monthly, or yearly. And </changefreq> is the closing tag.
- <priority> contains a manual priority value that indicates the priority stage of a particular URL to search engines. The priority value is from 0.0 to 1.0 where 0.0 indicates the least priority URL and 1.0 indicates the highest priority URL. The default priority value is o.5. And </priority> is the closing tag of this line.
4. Finally use this line to close the sitemap coding process:
5. You need to save and upload this file in the root directory of your site where the index file is situated. Keep in mind that a sitemap URL must be like this: http://example.com/sitemap.xml. Now your file is ready to be submitted.
Outlook of a complete sitemap:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.leadaleader.com</loc> <lastmod>2013-05-12</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> <url> <loc>http://www.leadaleader.com/blog/</loc> <lastmod>2013-05-12</lastmod> <changefreq>daily</changefreq> <priority>0.8</priority> </url> </urlset>
NB: You can repeat step 3 as much as needed to add different URLs in your file. You can also create it using free sitemap generator software but you can take more control on your site by creating a manual one.