site  news  contact

Submitting a sitemap to Google

September 10, 2017 — BarryK

For a shellCMS managed site, this has turned out to be easy-peasy.

A sitemap is a file, named sitemap.xml, at the root of your site, that helps the Google site-indexing-bot to discover everything on your site. It also works for some other search engines.

There are many tools to create this file, and this is a good links page to most of them:

Some of them cost money. But, right at the bottom of the page, I found this:

As shown on that site, just edit these three variables:

$url ""//The Url of the site - the last '/' is needed

$root_dir '../..'//Where the root of the site is with relation to this file.

$file_mask '*.php'//Or *.html or whatever - Any pattern that can be used in the glob() php function can be used here.

It is a good idea to hide create_sitemap.php in a folder somewhere on your site, to prevent every Tom, Dick and Harry from running it! if the name of the script is changed, there is one place in the script that will also have to be changed.

I changed $file_mask to "*.html", as my site is purely static.

For my host,, php scripts do not need any execute bits set in the php file, so it is just "644". I pointed my browser at the script, and the sitemap,, got generated, just about instantly.

Submitting to Google

You need to login to Google Webmaster Tools:

You need to register your website with Google, and Google will generate a file that you have to upload, to verify that you own the site.

After verification, you can submit your sitemap.

There are tutorial pages on how to do this. For example:

I decided that I might as well regenerate sitemap.xml everytime that I run remote-sync, so appended this line:

defaultbrowser &

Bing can also read a sitemap.

Submitting to Bing

Read instructions here:

You can join Bing Webmaster Tools, however there is one way of submitting the sitemap without having to join. As explained in the above link, point your browser at:

Of course, substitute your domain name. I tested this, it works, but you still would need to join Bing Webmaster Tools to get feedback on the submission.

This can also be put into the remote-sync script, to bring up that URI in your browser.

Ping Google too

Yes, this method of pinging can also be used for Google:

This is a good site that explains it, for all the search engines:

There is another way...


Another way to submit your sitemap to the search engines, is to create a file robots.txt at the root of the site. Put this into it:


But, you will have to wait until the search engine next visits your site.

Submitting to DuckDuckGo

You can't. DuckDuckGo gets it's information from Bing and Google, especially Bing. So, submit to Bing, and it will (eventually) end up at DuckDuckGo.

Tags: shellcms