Things You'll Need:
- Text editor, e.g. Notepad, ConText, Emacs Server space to host Web pages Active Google account HTML server
-
Step 1
Create the page headers. To create the page headers, all XML sitemaps require the same code. Copy the following to the top of a text document:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
The "<urlset>" tag serves as the root node. -
Step 2
Create the <url> tag. The url tag serves as the mother tag to each individual URL address provided. Simply type "<url>" under the "<urlset>" tag. The sample document in this article will only have two <url> tags.
-
Step 3
Create the "<loc>" tag. Type "<loc></loc>" under the "<url>" tag. Write the address of the Web page between the <loc> tags, for example:
<loc>http://www.your_domain.com/page_1.html</loc>
So far, your document should be as follows:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
<loc>http://www.your_domain.com/page_1.html</loc> -
Step 4
Create the "<lastmod>," "<changefrec>" and "<priority>" tags. To add these tags, type the following:
<lastmod>2009-07-20</lastmod>
<changefrec>daily</changefrec>
<priority>1.0</priority>
The "<changefrec>" tag can include "hourly," "daily," "weekly," "monthly" or "yearly." The "<priority>" tag information can be a value from 0.1 to 1. Close the input for page_1 with a "</url>" tag. -
Step 5
Add more URLs. You must open the next entry with a "<url>" tag and include the same information as for page_1. You can add up to 50,000 different URLs. Close the sitemap with a </urlset> tag. The entire sample sitemap should look as follows:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
<loc>http://www.your_domain.com/page_1.html</loc>
<lastmod>2009-07-20</lastmod>
<changefrec>daily</changefrec>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.your_domain.com/page_2.html</loc>
<lastmod>2009-07-20</lastmod>
<changefrec>weekly</changefrec>
<priority>.7</priority>
</url>
</urlset>
Note that page_2 has been assigned less priority and is changed on a weekly basis. Save the document as "sitemap.xml" and upload to a directory of choice on your HTML server. Make sure to add your own information. -
Step 6
Submit the sitemap to Google. Log into Google Webmaster Tools (see Resources below) and enter your website's address in the "Add a Site" option. When the address has been verified, select the "Sitemaps" option under "Site Configuration." You will then be given a text box where you must fill in the path to the sitemap on your server. Finally, press "Submit Sitemap."










