Submitting a sitemap to Google Search Console and other similar webmaster tools requires not the ordinary HTML sitemap, but the one that is XML formatted.
If this is where you’re at and you’re wondering how to go about creating one, here’s a walk through on how to create an XML sitemap for your website.
Manually generate an XML sitemap
One might say that to circumvent around the complicity of web programming is to just manually code stuff. Well, that can be done with an XML sitemap. You can definitely manually code it if you know XML.
Here’s a basic XML sitemap code structure to get your started. Just update and duplicate the <url> block, save the file as sitemap.xml, upload it to your web server and take note of its direct link or URL for reference (ex. https://domain.com /storage/sitemap.xml).
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/foo.html</loc>
<lastmod>2018-06-04</lastmod>
</url>
</urlset>
Once you created one, don’t forget to validate your file. There are good XML sitemap validators available online.
Disadvantages:
- Only ideal for sites with not that many webpages.
- Can be tedious and cumbersome to maintain especially when you have a website that’s expanding in number of pages on a monthly basis.
XML sitemap generation tools
Okay, so I probably have scared you a bit on the manual way of dealing with sitemap creation, so here’s an alternative – sitemap creation tools.
Thankfully, the web has a good amount of resource tools that can be used to generate an XML sitemap for your website. And you can easily find them by googling “xml sitemap generator.”
Once you found a tool, all you’ll be asked to provide is your website’s domain or URL and it will generate an XML file that represents your sitemap that you can download and upload to your server. Just don’t forget to validate your XML sitemap before submitting it to webmaster tools like Google Search Console.
Disadvantages:
- Has to be updated regularly as it’s still a static file that doesn’t automatically include newly added website pages
Generate XML sitemap with WordPress
If your website is running on top of WordPress, then it’s even easier to generate a sitemap.
WordPress has a great collection of plugins that can help you get by the task of generating and maintaining your website’s XML sitemap.
Yoast SEO is the plugin that I like and that does the job easily. With it, it’s like a set and forget kind of thing as once generated the XML sitemap is automatically updated every time a new page is added on your website.
How to enable and view the XML sitemap in Yoast SEO
- Install Yoast SEO plugin
- Once installed, on the left sidebar, click ‘SEO’ from the menu, and then click ‘General’ from the submenu.
- From the “General – Yoast SEO” page that’s brought up, navigate to ‘Features’ tab.
- From the list of options, look for “XML Sitemaps” and toggle it ‘on’.
- To get the XML sitemap URL that’s generated, click on the ‘?’ icon right next to “XML Sitemaps” heading.
- From the revealed help text, click on “See the XML sitemap” link. Doing so will load up the XML sitemap link and display it’s content. You can use this link for any XML sitemap link submission including Google Search Console sitemap submission.
Leave a Reply