Ten Textpattern Tips, #6: Adding a Sitemap

admin-ajax

Textpattern CMS can be used in Internet, intranet or localhost environments. In situations where your Textpattern site is hosted on the Internet, like Arvixe Web Hosting, you can create a search engine-friendly sitemap, essentially providing a catalogue of your site to Google, Bing and others.

For today’s instalment of Ten Textpattern Tips, I’ll show you how to use a plugin to add sitemap functionality to Textpattern and then submit your site to Google and Bing. For completeness, the tip for today is this: if you want people to find your Textpattern website content, get a sitemap. Don’t assume search engines will be able to magically find all your stuff.

The process breaks down like this:

  • install the sitemap plugin
  • tweak the configuration
  • update your robots.txt file
  • tell Google, Bing and other sitemap-friendly search engines

Sitemap functionality is not included in the core Textpattern product, but is trivial to add in by way of a plugin. The plugin – rah_sitemap – is one I consider essential for my Internet-side Textpattern installations. This plugin doesn’t have any file upload requirements, and can be easily installed from the Textpattern administration area. Installation is simply a case of copy and pasting some encoded text into text box.

Log into Textpattern with Publisher rights and go to Admin -> Plugins. You may see a list of installed plugins, you may simply see a blank box titled ‘Install plugin’, or thereabouts – both of these are fine. If you have a list of installed plugins, check to see if rah_sitemap is listed – if it is, then there’s no need to reinstall it.

If you don’t have rah_sitemap listed, visit the plugin page in another browser window and click download. You will see text in your browser window, similar to this (edited for brevity):

# Name: rah_sitemap v1.2 (compressed)
# Type: Admin/Client side plugin
# Build a valid advanced sitemap
# Author: Jukka Svahn
# URL: http://rahforum.biz
# Recommended load order: 5
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................
H4sIAAAAAAAAA819a3fbNrboZ/lXYJjcUGplSvIjD9lSJ3Xdjs9J0t7YnWlXT5ZLi5TEE0rk
kJQfnel/v/sBgOBDNJ0459yurFoEgY2Njf3CxgbojkfD8b/S8fOx5W6yZZRYR+l4NBpb/7H5
[...]
F97cfX710vX84eHo6urF4d6LF6/23cP5oQSMSBIQgGIGvaDoxdiSX52Q0EfOnnX05/8DS59u
D82UAAA=

This text is the compressed, encoded version of the plugin. Highlight all the text, copy it and paste it into the Textpattern plugin box. Click Upload. The plugin will be decoded and decompressed, and show you a preview of the code. On this verify page, scroll down and click Install to confirm. From there, the plugin will be installed but not active. You’ll be shown the Plugin tab again, but this time there’s a reference to rah_sitemap in the list. You will see that the Active status is set to No – to enable (activate) the plugin, click No; the action of clicking will refresh the status and turn it to Yes (active).

Now your plugin is activated, it’s time to check the sitemap works for your site. Click the Admin tab and you will notice a new Extensions tab. As an aside, this Extensions tab is not visible when the Plugins tab is active. This is a deliberate measure in case you need to deactivate or tame an errant plugin. Click on Extensions, then the Sitemap sub-tab. Out of the box, the sitemap plugin is configured with sensible settings, so we’ll continue as-is for now. Should you choose to update your sitemap settings, they will be reflected immediately as the sitemap is dynamically created. Check your sitemap works by clicking ‘View the sitemap’. You will either see some XML text in your browser, or a file will download, or your feed reader will open – all of these are fine.

Make a note of the sitemap URL. At the time of writing, the URL is:

http://example.com/?rah_sitemap=sitemap

Next up, add this information to robots.txt to tell robots where to look for the sitemap. This is an additional action to explicitly telling Google and Bing about the sitemap, other search engines may well make use of the information contained inside. Textpattern doesn’t ship with a robots.txt file, so create a text file with that in the Textpattern root (alongside index.php) with the following contents:

Sitemap: http://example.com/?rah_sitemap=sitemap

Remember to put your own sitemap URL instead of the example.com I use. Now your sitemap is set up, you can use Google Webmaster Tools and Bing Webmaster Tools to add your site, complete with dynamically-generated sitemap for optimum freshness.

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , , , , , , | Posted under Textpattern | RSS 2.0

Author Spotlight

Pete Cooper

Pete Cooper

Pete Cooper has been using Textpattern since 2005. Textpattern is his preferred CMS weapon of choice. Its logical and flexible approach to content management makes Pete happy, as does its lightweight core and helpful user community. Pete's website - petecooper.org - runs on top of Textpattern and chronicles his day-to-day experiences from his home near the Atlantic in north Cornwall, United Kingdom.

Leave a Reply

Your email address will not be published. Required fields are marked *


5 + = 13

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>