Sitemap is a blueprint of your website that help search engines to find, index all of your website's webpage. A sitemap contains XML file that lists your websites URLs.
The sitemap should be standard format. The file itself must be UTF-8 encoded. The sitemap should content below xml tags.
1. Sitemap should begin with an opening
<urlset> tag and end with a closing
2. Specify the namespace within the
3. Include a
<url> entry for each URL, as a parent XML tag.
4. Include a
<loc> child entry for each
<url> parent tag.
In addition to above tags, you can also add other tags in each
<url> parent tag.
<lastmod> tag which shows date of last modification of the file. This date should be in W3C Datetime format. However you can use
<changefreq> tag tells search engines how frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. The valid values include:
<priority> tag describes priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0. The default priority of a page is 0.5.
Your Sitemap file must be UTF-8 encoded. As with all XML files, any data values like URLs must use entity escape codes for the characters listed in the table below.
Sample XML Sitemap
The below example shows a Sitemap in XML format.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://laravelcode.com/article/how-to-completely-remove-package-from-ubuntu</loc> <lastmod>2021-03-26T13:37:02+00:00</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> <url> <loc>https://laravelcode.com/article/how-to-create-get-and-post-request-using-python-requests-module</loc> <lastmod>2021-03-22T13:19:48+00:00</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> <url> <loc>https://laravelcode.com/article/how-to-store-multiple-checkbox-value-in-database-in-laravel8</loc> <lastmod>2021-03-22T06:31:19+00:00</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> <url> <loc>https://laravelcode.com/article/reactjs-file-uploading-example-with-axio</loc> <lastmod>2021-03-22T06:14:38+00:00</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> </urlset>
Once you have created the Sitemap file and placed it on your webserver, you need to inform the search engines that support this protocol of its location. You can do this by:
3. Ping search engine to your Sitemap url. Example for google:
Use PHP Code into Laravel Bladein this article, I will share with you h...
How To Install the Django Web Framework on UbuntuDjango is one of the best and very popul...
How to populate state dropdown based on option selected in country dropdown using jQueryUse the jQuery ajax() method...
How to populate dropdown list with array values in PHPUse the PHP foreach loop Yo...