Reputation: 504
i created a dynamic sitemap using php you can see my site map in this link
i am going to submit this link to google webmaster tools but i dont know is this right way to publish all of sitemap in 1 page or maybe using pagination for this?i dont know which way is correct but this site make 500 or 600 user a day and i think its not a right way ro insert all of them in sitemap..now need help on this
here is my code to create this site map
header("Content-type: text/xml");
$xml = new DomDocument('1.0', 'utf-8');
$xml->formatOutput = true;
// creating base node
$urlset = $xml->createElement('urlset');
$urlset -> appendChild(
new DomAttr('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9')
);
// appending it to document
$xml -> appendChild($urlset);
// building the xml document with your website content
foreach($content as $entry)
{
//Creating single url node
$url = $xml->createElement('url');
//Filling node with entry info
$url -> appendChild( $xml->createElement('loc', $entry['permalink']) );
$url -> appendChild( $lastmod = $xml->createElement('lastmod', $entry['updated']) );
$url -> appendChild( $changefreq = $xml->createElement('changefreq', 'monthly') );
// append url to urlset node
$urlset -> appendChild($url);
}
echo $xml->saveXML();
?>
Upvotes: 1
Views: 1537
Reputation: 774
Creating Sitemaps - Google Webmaster Tools
A Sitemap file can contain no more than 50,000 URLs and must be no larger than 50MB when uncompressed. If your Sitemap is larger than this, break it into several smaller Sitemaps.
If you have more than one Sitemap, you can list them in a Sitemap index file and then submit the Sitemap index file to Google.
Upvotes: 1