How to Create Dynamic Xml Sitemap in Codeigniter

How to Create Dynamic Xml Sitemap in Codeigniter

In this tutorial, we will explain to you how to create dynamic xml sitemap in codeigniter. It helps us to we can easily submit XML sitemap into the google console. so our website can easily rank on google.

A sitemap is described navigate of the website. users can easily search to navigate the site by sitemap. it is creating in the XML coding.

We have given below an example of how to generate a dynamic XML sitemap using Codeigniter. Add the below code in your controller file and Get the data from the database you want to create sitemap URL and pass it in the view file.
So you can follow the below steps.

Create Sitemap Controller

Add the below code in your controller file and Get the data from the database you want to create sitemap URL and pass it in the view file.
application/controllers/Sitemap.php

 

Create XML File.

Add the below code in this file. in this below code in the product name wise create a dynamic XML sitemap and when this code run at that time sitemap.xml file is automatically uploaded to your root directory of the project folder.
application/views/sitemap.php

you can run on following URL for submit XML sitemap into the google console.

Please follow and like us: