CodeIgniter Forums
How to create sitemap XML? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forum-1.html)
+--- Forum: Lounge (https://forum.codeigniter.com/forum-3.html)
+--- Thread: How to create sitemap XML? (/thread-72257.html)



How to create sitemap XML? - Aqeel664 - 11-27-2018

I have the store based website I want to create sitemap XML but I didn't know how to create please help?


RE: How to create sitemap XML? - InsiteFX - 11-28-2018

Google Sitemap Generator


RE: How to create sitemap XML? - marwin - 12-08-2018

You can dynamically create an XML sitemap in CI through a cronjob executed function that builds the XML based on your specific content setup. Simply loop through the individual content tables and add the relevant data:

Set the orgins, then loop through the origin by getting that table from the DB then loop through the origin content to build the XML. Ideally for each orgin you build an extra XML and create a master sitemap.xml while you are at in case you exceed 50k pages.

Then just store the XML on the server (i.e. @file_put_contents('./sitemap.xml', $sitemap); and you are good.