Creating a SiteMap File

Introduction

This is to do with Google Webmaster Tools (GWTs). This is a facility supplied by Google for WebMasters to use to help Google “crawl” their website. It should therefore help with Search Engine Optimisation (SEO). I haven’t written any other posts about Google Webmaster Tools yet but am still finding my feet with it myself. But this is a key area. This post assumes that you have already registered your site, and/or the alternative versions of your site (http:/, http://www, https://, https://www, etc) in your Google Webmaster Account.

What a sitemap.xml file is, is essentially a list of all the posts and pages on your website. It also tells the Google Search Engine how often you update your site. It does appear, however, that the frequency of your updates to the site is listed for each page or post. More about that presently.

Google Webmaster Tools

In GWTs Home Page https://www.google.com/webmasters/tools/home?hl=en
Select one of your sebsite URLs (called “properties”, as they are likened to Real Estate properties). Under Current Status, you see three items:- Crawl Errors, Search Analytics and Sitemaps. If you have not yet submitted a sitemap file to GWTs then it won’t have any information under Sitemaps yet.

Google WebMaster Tools Dashboard page for https://www.ourlife.co.uk/
Creating a SiteMap

I guess that you could build a sitemap file manually, it is not very complicated. But there is no need. There is a simply wonderful site that does it for you at https://www.xml-sitemaps.com/

Sitemaps.com Start Page
Sitemaps.com Start Page
Which URL does one use for ones Sitemap?

One question is, if you have a “Property Set” in Google Webmaster Tools, then do you have to create a SiteMap for each of the URLs in the Property Set?
Well I found out the answer to this the, slightly, hard way. The answer is that you use your “Preferred Domain” to create your SiteMap and your Preferred Domain ought to be the Site Address URL. If you go into WordPress, Settings, General, then it shows your Site Address (URL). I know this as I had to change this when I changed my site, by adding an SLS certificate, from http:// to https://. (see: https://www.ourlife.co.uk/building-a-website/ssl-going-from-http-to-https/)

WordPress > Settings > General. Showing Site Address (URL)
WordPress > Settings > General. Showing Site Address (URL)

So the answer came about because I tried all four URLs in my Property Set:

All the URLs (Universal Resource Locator) in my Property Set
All the URLs (Universal Resource Locator) in my Property Set

Now, it is the last one that is my “Site Address (URL)”, set in WordPress. So this is the only one that works in https://www.xml-sitemaps.com/. All the others show an error.

Create SiteMap.XML

Put your details in the appropriate boxes in https://www.xml-sitemaps.com/ :-

https://www.xml-sitemaps.com/ Details box
https://www.xml-sitemaps.com/ Details box

You have to fill in your website URL, The frequency which you update the web site, the “Last Modifictaion”, leave this to the server as per default, and “Priority”, again set this to “Automatically Calculated Priority”. Then click Start. You get a different page that says “Please wait. Site Generation in Progress…”

Please wait. Site Generation in Progress.
Please wait. Site Generation in Progress.

You then, after a little while, get another webpage that lets you download your sitemap.xml file.

Created sitemap.xml file ready for download.
Created sitemap.xml file ready for download.
Save sitemap.xml to your PC, and a little HouseKeeping

Save the file to your own computer. As an aside; I keep copies of all my posts on my computer. In WordPress, just press ctl+a then ctl+c and then use Notepad++ and press ctl+v to paste the text in to Notepad++. Then save as whatevertitle.html in a folder structure in your Documents. I have a sub-folder for each post that contains this html file, which you have to re-do when you update the post, and also the picture files. Notepad++ then shows the html file in different colours etc. Nice. Anyway, keep a copy of the sitemap.xml file for your self too. It looks like this:-

sitemap.xml file shown in Notepad++
sitemap.xml file shown in Notepad++
Upload sitemap.xml to public_html

Upload the sitemap.xml file to your home directory: Public_html, using FileZilla or whatever. Hostgator provides its own file manager. See below.

File Manager (Windows Explorer) from Hostgator
File Manager (Windows Explorer) from Hostgator
Back To Google Webmaster Tools to Test sitemap.xml

Then you want to tell Google Webmaster Tools about your sitemap.xml file. Now, you don’t have the option to do this under your Property Set so, in the Webmaster Tools so select your preferred domain. So go to

https://www.google.com/webmasters/tools/dashboard?hl=en&authuser=0&siteUrl=http://www.ourlife.co.uk/
Obviously you will select your own URL. Then, on the left hand side, select Crawl and Sitemaps
Then select the Red Button that says ADD/TEST SITEMAP

Crawl Sitemaps
Crawl Sitemaps

Then add “sitemap.xml” to you URL name that pops up

ADD/TEST SITEMAP
ADD/TEST SITEMAP

Make sure that you DO select your preferred domain, that you used to create the SiteMap. Also, if it doesn’t work first time then try clicking “refresh”

After it shows you the pages submitted, worth a look over, then press the red ADD/TEST SITEMAP button again. Then Select TEST.
Then click the blue View Test Result button.

It should say “no errors found” PHEW!!

no errors found
no errors found
Do I need to update sitemap.xml when I update my website, or add more posts to it?

To be honest I don’t know the answer to this. I tried a Google search of this question and didn’t find very much. I apologise to anyone else who has searched for an answer and landed here 😳 . I did find this article on seachat. That article is six years old but it does hint that Google does update the sitemap. So I would guess that now, it certainly does. Also, if you look back to my Crawl Sitemaps picture, above, (expanded below) then you can see that there are two options: “By me” and “All”. And you can download these, so wait a week or two, depending on the update frequency you set in https://www.xml-sitemaps.com/, and check back to see if it is updated. But once you have created and submitted a sitemap, in the way I’ve described in this post, then it would likely expedite your websites’ SEO to just whizz through the process every now and then.

Crawl Sitemaps Expanded
Crawl Sitemaps Expanded

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.