It’s no shock to SEOs that having an XML sitemap is an essential task on your to-do list. It gives you that one chance to whisper sweet nothings into Google’s little robot ears. “Sweet nothings” in this case being “all the pages of your website that you want to be crawled”.
Many people choose to use an XML sitemap generator as a quick way to knock this off their to-do list. Pfft! Why not just do it yourself? Who knows your site better than you? Knowing how to build one “by hand” is a great skill to have and I’m sure you’ll impress everyone at parties when you show them how (just kidding, please don’t do that).
This is the foolproof method that I’ve come to know and love ever since I started making XML sitemaps. It guarantees control over exactly what is to be included in your sitemap, and an even bigger bonus: it’s in alphabetical order. Swoon. You can rest easy knowing you made a clean, beautiful sitemap all by yourself! <pats your back>
Let the fun begin.
Note 1: this method is intended for smaller sites (<100 pages roughly) but is definitely scalable.
Note 2: pay no mind to the example page names. That’s just what happens when you work for plastic surgeons.
1) Log in to your FTP client of choice. I’m using Transmit here.
2) Start with a clean slate. Be sure to rid the server of old files that either no longer exist or 301 redirect. You don’t want Google to get redirected or sent to a 404 page from your XML sitemap. Big no-no.
3) Select all of the pages from the root of the site that you would like to include in the sitemap. (Exclude image files, the 404 page, “thank you” pages, BingSiteAuth.xml files, robots.txt, etc.)
4) Right click the selected files and “Copy URL”
5) Create a new HTML file under the root directory of the site and paste the copied URLs from step 4. It should look something like this:
6) Find and replace all the junk that you don’t need with all the junk you DO need.
7) Finally, add the fancy schema bits to the beginning and end of your sitemap, and save it as “sitemap.xml” to the root of the site.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.schema.org/schemas/sitemap/0.9">
The Finished Product
Let me know if you try this method and how it worked out!
(A Note About Priority)
Wait, but what about priority, Emma?! Priority, schmiority. The point here is to keep it simple and clean. I’ll risk leaving out priority for simplicity’s sake since it’s optional, anyway.