Skip to main content

How to generate the sitemap of your Joomla site and enter it into Google Search Console

| Gianluca Gabella | Joomla!
share on facebook share on twitter share on linkedin

Index:


We are opening a new column with this post: 'Best practices for Joomla sites and the fundamental components for implementing them'! The first understanding concerns the creation of the sitemap of your Joomla! site and how to communicate it to the search engine par excellence, Google.

WARNING: the guide is also valid for Joomla4! The OsMap component is now also compatible (from version 5.0) with the new major release of Joomla.

What is the sitemap?

The first, fundamental question is: what is a sitemap? And why do I need it for my site?

The answer seems simple but carries with it many SEO implications. The sitemap is, as the name suggests, a map of all (or almost all) the pages of the site, written in a way that a robot (e.g. Google's crawler or Search Console) can read it, interpret it and exploit it to better index a site.

The most common system is the creation of an XML containing all the pages of the site, together with some information such as the periodicity of updates or the date on which the page was last modified. As per Google specifications, an example of an XML might be the following:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>

If you want to see the sitemap of the pixed site, you can see it here: https://www.pixed.it/component/osmap/?view=xml&id=1&format=xml

So, to recapitulate, the sitemap is a summary of all the site's contents written in such a way that a computer can read and process it easily.

How do I create a sitemap for my Joomla site?

Since the sitemap is a simple XML, you could theoretically write it by hand. But the problems are many: first of all, if there are many pages, it would take you forever. In addition, every change you make on the website would also have to be reported on the sitemap, making the work almost impossible.

Joomla from this point of view gives us a hand: although there is no native system for the creation of the sitemap there are components (both free and paid) that do this job very well for you.

The first component we are going to look at is OSMap.

The basic version is free and is very well suited for a simple site like Pixed's: static pages, blogs, portfolios, etc., all easily managed by this component.

First let's download the component from the link above, by clicking on the "free" button at the bottom of the page:

osmapfree

Now simply enter your email address and within a few seconds you will receive an email containing the download link.

Download the package and install it like any other Joomla component: Top Menu -> Extensions -> Management -> Install.

Once installed, the component looks like this:

osmapcomponent

The first thing to do is to click on the 'Sitemap' link (bones on the name of your sitemap).

Inside you will find a list of selectable items which are none other than your Joomla menus. There will be the main menu and any other menus you have created on the site.

It is important to only select menus that are visible to the public, i.e. menus containing pages that you want to index. Why? Because if you also put 'service' pages in the XML, then Google will try to index them even if there is no real need. Examples of 'service' pages might be the ecommerce shopping cart, or the search results page, or pages that have restricted access (e.g. the user's personal area).

For example, I always create a public main menu and a menu where, inside, I insert all the links that I do not care to be indexed. For example, on Pixed's site there are these two menus:

osmapmenulist

As you can see, there is the 'Main Menu' where there are all the 'public' links and a menu called 'ext' where there are all the service pages. So, to conclude, I only selected the "Main Menu" and clicked "save".

As for the fields "priority" and "change frequency" you can leave the default values.

The end! The sitemap is created and you can see the final result by clicking on the "XML" link in the "sitemap links" column of the component screen. A new window will open, keep it open and note down the URL because you will need it in a moment.

How to enter the sitemap of your site in Google's Search Console

The first part is done, now we come to the crucial step for the proper indexing of your website.
Google provides many tools to optimise your site, and they are all free. The most widely used are certainly Google Analytics and Google Search Console.
The former is used to see how many and which people visit your site: it has thousands of options and allows you to have a very detailed overview of the traffic coming to your site. Learning to use it well is not easy and can take months of effort, but I assure you that it will be worth it.

The second tool I mentioned is Google Search Console.

Explaining in a few words what this tool is for is practically impossible. Let's say it gives you a hand in managing your site's URLs to see if they work (or give errors) and whether they are indexed or not. It is also useful for hundreds of other things, but that is not a subject we will deal with now.
One of the functions that Search Console makes available to you is the possibility of inserting and monitoring a sitemap of your site. This sitemap will be used by Google to better index all pages and monitor their indexation status. So let's go and insert the sitemap we have just created.

First of all, click on the link above to get to the Search Console.

We enter our Google credentials (you need a Google account to be able to use Analytics or Search Console, but you can create one for free here: https://www.google.com/account/about/ by clicking on the 'create an account' button at the top).

If we have never created one, we must create it by following the steps suggested by Google. It is very simple, can be done in 5 minutes, and you can follow this guide: https://support.google.com/webmasters/answer/34592?hl=it

Once the property has been created, we will find the "Sitemap" entry in the left-hand column:

osmapsitemap

Clicking on it will open a page where we can manage the sitemap(s) of our website. To insert a new one, the procedure is as follows:

  • Open the browser page where there is the sitemap created by OsMap (the one I had you open earlier by clicking on "XML" in the component view)
  • Copy the URL of the page
  • Go back to the search console and paste the URL into the field at the top where it says "Add a new sitemap".
  • Click on SEND

If everything was successful, Search Console should tell you that there were no errors and that your sitemap was entered correctly. The result will look something like this:

sitemappixed

The end! Your sitemap has been created automatically, will be maintained by the OSMap coponent and will be constantly checked by Google to see if new content has been added.

Last step: add the sitemap to the robots.txt file

Unfortunately (or fortunately!) there is not only Google. It is good practice to put your sitemap also in the robots.txt file, so that all other crawlers coming to your site can read it correctly.

To do this, simply download the robots.txt file from the root of your site via an FTP client such as FileZilla and edit it by inserting a string like this:

Sitemap: https://www.sitoweb.it/url-della-sitemap

In which we put the words "Sitemap:" then a space and finally the URL of the XML sitemap page created by OSMap.

The result will be similar to what you read in the sitemap of the pixed site: https://www.pixed.it/robots.txt


If you liked this article, please share it!

share on facebook share on twitter share on linkedin
condividi su Facebookcondividi su Twittercondividi su LinkedIncondividi su WhatsAppcondividi su Telegram