Answered by
Oliver Hall
An HTML sitemap is a page on your website which lists all the important pages on your site. It allows users to navigate through the site more easily and helps search engine bots discover and index your pages for better search engine rankings.
To create an HTML sitemap, follow these steps:
First, list down all the pages of your website that you want to include in the sitemap.
Once you have the list, you can start writing the HTML code for it. The sitemap is essentially a nested unordered list (<ul>
or <ol>
) of links (<a href="#">
).
Here's a basic example:
<!DOCTYPE html> <html> <head> <title>Sitemap</title> </head> <body> <h1>Sitemap</h1> <ul> <li><a href="/">Home</a></li> <li><a href="/about/">About Us</a></li> <li> Services <ul> <li><a href="/services/service-1">Service 1</a></li> <li><a href="/services/service-2">Service 2</a></li> </ul> </li> <li><a href="/contact/">Contact Us</a></li> </ul> </body> </html>
In the above code, we've created a simple HTML sitemap with links to "Home", "About Us", "Services" (which has its own sub-links), and "Contact Us".
Remember to update your sitemap whenever you add or remove pages from your website.