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 </urlset>
tag.
2. Specify the namespace within the <urlset>
tag.
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.
1. The <lastmod>
tag which shows date of last modification of the file. This date should be in W3C Datetime format. However you can use YYYY-MM-DD
format.
2. <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:
3. The <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:
1. You can submit the sitemap to search engine Google Search Central, Bing Webmaster etc.
2. You can specify more than one Sitemap file per robots.txt
file.
3. Ping search engine to your Sitemap url. Example for google:
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to remove .php file extension from URL in apache
You may have seen some .php and .asp ext...How to check if Email already exists in laravel
Register and Login is basic fu...How to make the first letter of a string uppercase in JavaScript
Use the toUpperCase() method In JavaS...The requested URL was not found on this server
After installing phpMyAdmin, when you tr...How to add or remove package in Laravel application
When you upgrade your Laravel applicatio...