Write your own site map

Web authors sometimes ignore they can let search engines know how many web pages they have, as a way to invite them to add these pages to their indexes. Uploading a site map, you can do this easily.

How to write a site map

Search engines once agreed to have a common way to create site-map files. You can find that information on Sitemap.org. Below, you have the instructions to write a site map file by yourself, following the minimum Google's directives.

<?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>//heptagrama.com/</loc></url>
<url><loc>//heptagrama.com/404.htm</loc></url>
<url><loc>//heptagrama.com/index.htm</loc></url>
</urlset>

In the example above, I have included three web pages, each of them under their own <url> and <loc> tag. To complete your site map, you just need to list all your web pages under those same tags.

Save your file as sitemap.xml and upload it to your site. You can compress it, but use GZip format only. This, because most web servers use Linux as operative system.

Lastly, include the address or your site map on your robots.txt file. For my example, the line is:

Sitemap: //heptagrama.com/sitemap.xml.gz

That's it.


Knowledge + Computers