Sitemaps

What is a Sitemap?

On a surface level, the name of a sitemap is fairly self explanatory, it's a map of your site. However, on a technical level, there is actually a specific protocol for writing sitemaps on the web that uses standardised XML formatting that gets used by things like search engine crawlers to index your site.

What's in a Sitemap?

At it's most basic a sitemap only requires URL entries with locations of each page included in the site map. But you can also include other details such as the last modified date etc. For the different types of data you can include check out the sitemaps.org page on the sitemap protocol

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <url>
        <loc>https://yoururl.com/page1</loc>
    </url>

    <url>
        <loc>https://yoururl.com/page2</loc>
    </url>

</urlset> 
            

How do you generate a Sitemap?

If you don't feel like handcoding your sitemap, there's lots of tools and generators out there that'll do it for you ! If your site is already live on the internet and you don't have any pages that aren't linked anywhere, xml-sitemaps is a great option (provided you have under 500 pages). You just pop in your URL, and it crawls through all the links on it, and creates a sitemap.xml file which you can upload to your site. If you have it at the root of your site and named sitemap.xml it will often be autodetected by the tools it is intended for, but you can also specify it in your robots.txt which I intend to make a tutorial on for within a few days!
For those who don't have their sites currently live, have hidden pages not linked anywhere, have more than 500 pages, or who just want a local piece of software, I'm still exploring the options that are available out there before I recommend any specific software.
I also intend to look if there's any easy scripts or anything that can allow sites to use their sitemap.xml to display a user-friendly sitemap view in html, but that'll have to come at a later date!