The link you posted does a fine job of creating an XML sitemap, for small sites. The online tools are limited/slow because they have to crawl your site to find links and rely on the presence of a last modification header to add that data to the sitemap.
If you have experience with a server-side language you can generate/manage your sitemap using that. PHP has some handy XML functions to manipulate XML.
When you have a very large site, you will need to make sitemap index files. This is a good read to familiarise yourself with site maps: [
sitemaps.org...]
Below is a very simple PHP script I made to manage an XML sitemap. It creates an MD5 of the URL so entries can quickly be found when requiring an edit. I edited slightly but it should work as is.
generate();
}
}
public function load()
{
global $dom;
$dom = new DOMDocument;
$dom->preserveWhiteSpace = true;
$dom->loadXML(file_get_contents('Sitemap.xml'));
}
public function generate($flag)
{
global $categories,$dom,$urlset;
$dom = new DOMDocument();
$dom->loadXML('
');
$urlset = $dom->getElementsByTagName('urlset')->item(0);
// Example adding of home page
$this->add_url(array('loc'=>'http://'.$_SERVER['SERVER_NAME'].'/'));
// Iterate through the rest of your known website URLs here and apply this function
// $array contains key=>value pairs to add to the sitemap where 'key' is a tag and 'value' is its contents
$this->add_url($array);
$dom->save('Sitemap.xml');
}
public function add_url($vars)
{
global $dom,$urlset;
if(!isset($urlset))
$urlset = $dom->getElementsByTagName('urlset')->item(0);
$node = $dom->createElement('url');
$node->setAttribute('id',md5($vars['loc']));
foreach($vars as $key => $var)
{
$node2 = $dom->createElement($key);
$node3 = $dom->createTextNode($var);
$node2->appendChild($node3);
$node->appendChild($node2);
}
$newnode = $urlset->appendChild($node);
$vars['md5'] = md5($vars['loc']);
}
public function editlastmoddate($id)
{
global $dom;
$xpath = new DOMXPath($dom);
$mod = $xpath->query("/urlset/url[@id='$id']/lastmod");
$mod->item(0)->nodeValue = strftime("%Y-%m-%d",time() - gmmktime() + mktime());
$dom->save('Sitemap.xml');
}
public function deleterow($id)
{
global $dom;
$xpath = new DOMXPath($dom);
$urlset = $dom->getElementsByTagName('urlset')->item(0);
$row = $xpath->query("/urlset/url[@id='$id']")->item(0);
if($row)
$row->parentNode->removeChild($row);
$dom->save('Sitemap.xml');
}
}
?>