hit counter joomla

How to Create A Sitemap.xml in Joomla 2.5

A Joomla Sitemap.xml file is no different than any other sitemap really. What a sitemap.xml file does is hold critial information about your Joomla website's URL structure and articles. It might contain short descriptions and image links as well. 

A Sitemap.xml file helps Search Engines Crawl your site.

The above description pretty much says it all, but how do you set up a sitemap.xml file in Joomla?

I just added one to one of my projects, and documented the process to share with all my Joomla User Group Detroit Friends!

Set Up a Joomla Sitemap Tutorial

First of all, I really recommend "XMap" by Guillermo Vargas. Xmap is a generator component for Joomla, and is available for J2.5 & J3.0. Xmap makes it easy for you to create a sitemap of your website using your menu(s) structure. Xmaps re-generates the sitemap automatically, so you don't have to keep going back to it to do updates. You can also visit the change frequency for each menu. Xmap on the Joomla Extension Directory

 


 

Setting up the Xmap Component

I'm going to make the wild assumption that you know how to install extensions in Joomla, so skipping to the good stuff, you first have to activate at least two plugins that were automatically installed with the component:

Go to Extensions > Plugins and type "xmap" in the filter to give you this list:

activate-xmap-plugins

Make sure you have both the content and weblinks plugins activated (green checks), and if you use any of the other mentioned extensions, activate those as well.

Next, you will want to go to Components > Xmap and click "New" to create your first sitemap.

xmaps-new-sitemap

You can name your sitemap anything you want, but your first one could be nothing more than "sitemap". Fill in the description if you want, make sure that the "status" is set to publish, then on the right, open the "menu" dropdown if it's not already open:

 xmap-menu-selector

Choose your main menu for your first sitemap, plus any other menus that are publically accessable that have content that you want the search engine spiders to crawl. In my case (using JoomlaDetroit.com as an example), I would choose "main menu" and "footer menu". Both have content that I want crawled. I then would change the frequency on the home menu to "daily" as I write blog content almost daily. If you only do updates once a week or less, leave it at "weekly" or even set it to "monthly".

A word about the "Priority" setting

The priority setting tells the search engine that certain pages are more important than others. This does not mean your pages are more important that pages on other websites, but rather, just your own site.


Looking for other Joomla Resources?
Don't waste your time searching for hours on the JED! Check out our trusted Joomla Resources page!

So next is the Xmap options tab

The only two things that you need change are the Compress XML and Beautify XML settings. These should be set to "no". Google errors out when trying to craw a beautified and compressed XML page, so just for safety's sake, set these to "No". Click Save & Close, and you're done creating your sitemap.

Go back to the "Sitemap Manager" page if you aren't taken there automatically. It can be found by clicking Components > Xmap. You will now see your new sitemap:

xmap-sitemap-manager

The next part is a little tricky... Open up your FTP client and connect to your site. In "public_html", "www" or "htdocs" folder (world accessable folder), you will have to change the .htaccess or htaccess.txt file.

At the bottom of the file, using your favorite text editor, add the following lines:

RewriteCond %{REQUEST_URI} ^/sitemap.xml
RewriteRule .* /URL-to-sitemap-here

 

The URL to the sitemap will be found next to the start in the image above. copy the link and paste into the text editor, stripping out the domain and beginning and ending slashes:

http://joomladetroit.com/index.php?option=com_xmap&view=xml&tmpl=component&id=1/

becomes

index.php?option=com_xmap&view=xml&tmpl=component&id=1

So the second line of the rewriteRule should look like this:

RewriteRule .* /index.php?option=com_xmap&view=xml&tmpl=component&id=1

Save the file and re-upload to the server.

You should now be able to access the sitemap by going in your browser to:

http://YOUR-DOMAIN.com/sitemap.xml

or, if that fails or you do not have access to the .htaccess/htaccess.txt,

http://your-domain.com/index.php?option=com_xmap&view=xml&tmpl=component&id=1

That's it! you are ready to have your website crawled, and best of all, the map automatically updates itself!

EXTRA CREDIT: Initiating a Site Crawl with Google Webmaster Tools

 Go to your site's webmaster tools account and from the left navigation, go to Optimization > sitemaps. There will be a little red box in the upper right that says "ADD/TEST SITEMAP". Click on the box, and add "sitemap.xml" or the long URL string and click test.It's always best to test the sitemap before you actually submit so you can verify that there's no errors with the map.

webmaster-tools

add-sitemap

If the test was a success, you should see something like this:

 

sitemap-complete

Now close this, and do the same thing, adding the sitemap button > enter sitemap's URL exactly the same as you did for the test, but this time, click the submit button and it send Google the sitemap for submission.

Initiate the Crawl

Now you will want to tell Google to Crawl your site. Since you installed the sitemap, things should be pretty worry-free. On the left navigation, go to Health > Fetch as Google.

You can only do a full site crawl 10 times, so be frugal (I used one up for this tutorial too)

fetch-as-google

For a full site crawl, don't enter anything in the box to the right of the domain name. Just click fetch. Fetching won't cost you anything. When you submit is when they dock you for a submission.

fetch-as-google-complete

Just click the "submit to index" button, and you're done. It's rather anti-climatic because you wont see any changes to your site, nor will you see anything happen on your Google ranking or search display for a while. It can take a couple days for changes to happen. Just be patient, though. You can sit back and rest assuredthat you did it correct.


Looking for other Joomla Resources?
Don't waste your time searching for hours on the JED! Check out our trusted Joomla Resources page!
 

 


People in this conversation

Load More

Leave your comments

Post comment as a guest

0 / 2500 Character restriction
Your text should be in between 10-2500 characters
terms and condition.

Around Joomla!

  • Attending the Joomla World Conference #JWC17 as a team member

    Displaying items by tag: English Dec 5, 2017 | 16:41 pm

    Last month I attended the Joomla World Conference #JWC17 in Rome, Italy. Since my first JWC visit to Vancouver last year, I've joined a couple of global teams including Showcase, Certification and the Joomla Community Magazine (JCM), where I help out with things like moderation, English-language proof reading and documentation. This year, in addition to the actual conference, I also got to attend some team meetings prior to and during the conference.

    Read more...
  • The December Issue

    Displaying items by tag: English Dec 5, 2017 | 15:33 pm

    Another year is coming to its conclusion and the Joomla Community has a lot of great news to share in this issue!

    Read more...
  • Volunteer to Learn

    Displaying items by tag: English Dec 5, 2017 | 13:02 pm

    Help a non-profit while helping yourself! Broaden your CMS horizons and give back to the community at the same time. I’ll share how I learned the Joomla! CMS and how I continue to expand my capabilities. Just getting started with Joomla? Read on. 

    Read more...
  • Episode IV - A new User Interface for the Joomla Backend

    Displaying items by tag: English Dec 5, 2017 | 11:01 am

    On November 17, the first Alpha for Joomla 4 was released. Whilst this release was intended for developers to check their extensions as soon as possible for their compatibility the Joomla 4 User Interface Team has something nice in store for you. In the last few years, we have been planning, discussing and drafting different concepts of the Joomla 4 backend. First of all: the chance to work on the overall backend user interface is a really big honour for us and we say thank you to all those that welcome us to such a great team. It’s a pleasure to work with such passionate people. Our challenge was to design a backend that mostly fits into the given technical structure of Joomla and to change as much as needed, but as little as possible. We want to invite you to take a ride through the draft of the Joomla[…]

    Read more...
  • GSoC at the Joomla World Conference 2017

    Displaying items by tag: English Dec 5, 2017 | 08:06 am

    GSoC 2017 was also Joomla’s 10th anniversary in the program. At the Joomla World Conference, 5 students and their mentors came together, meeting for the first time in person. The event also offered the opportunity for Students, Mentors and Admins of the program to share their experience with the program to the Global Community through a panel hosted by Nick Burch from the Apache Foundation.

    Read more...
 

Posted By:
Joomla User Group Detroit

Organizer,

Donations and Gifts

Donations that go to keeping the Meetup 100% Free are welcome!