Maximising Google SEO and Adsense ad relevance for XOOPS


Maximising Google SEO and Adsense ad relevance for Xoops

Used correctly the Google search engine is a great tool for generating some traffic for your site, and in turn the Google Adsense program can be a great way of monetizing that traffic. A problem can arise here though if you are running a site on a system such as Xoops with dynamically generated content, and you may find yourself with advertising that is totally irrelevant to the content on your site. The problem with this is that very few of your visitors will click on these ads as they are of little relevance to why they came to your site in the first place. This in turn reduces the the amount of money you get paid for each click as you'll only be delivered very cheap ads that are using very generic keywords. However it doesn't have to be like this, and it can be as simple as adding a few items to the HTML in your Xoops theme, and modifying the way your module generate their page titles.


This article explores how altering the way your page titles are generated can result in a huge increase in the relevancy of the ads being delivered to your site from the Google Adsense network. This article does not involve complex ideas, but does involve editing some HTML so some basic knowledge of this would help. A good level of understanding of both the Xoops and the Google Adsense interfaces as well as advertising terminology is also assumed.


First off let me point out that I do not claim to be any sort of expert on this, and the fact that I still work a regular day job is testament to this. However having only become interested in this topic around the middle of this year, I believe that what I have learnt and seen with my own eyes would be a valuable to those who are just starting out in this area.


From my experimentation the reason that Xoops is not generally very search engine friendly and delivers irrelevant ads is due mainly in the way most meta data and page titles are generated. With meta data, most of the problem comes down to how most themes use the available Xoops smarty tags, and the lack of some basic search engine friendly practices. However, this is only half the problem as the current functionality within the Xoops core for generating meta data does not allow you to do it on a per page basis. There are some modules now supporting the creation of per page meta data such as the News module.

Generating page titles is currently the responsibility of each Xoops module, but not all of them actually generate individual page titles which is essential for not only delivering relevant ads, but also for SEO. Even those that do generate individual page titles more often than not do not generate them in a fashion that is friendly for delivering relevant ads. This is because most of the time page titles are generated in the format of site name - module name - category - item name. The effect this has is that the start of the page title is always going to be the same, and search engines are going to look at this as duplicate data and will start degrading it.


Getting your theme to be more Google friendly is not a massive task, and pretty much everything that I am going to cover here has actually already been documented at the main Xoops site in this great FAQ. In this guide we will be using existing Xoops smarty tags to enhance information that Google looks for when crawling your site. To do this you'll need a good text editor, and access to edit the theme.html file of the theme in use on your Xoops website.

Meta Keywords
  1. Look for the code that generates you meta keyword data, it should look something like this;


  1. What we are going to do here is add the page title tag so that this meta data is at least partially unique.

  2. Change this code to read;

content="<{$xoops_pagetitle}>, <{$xoops_meta_keywords}>" 

Meta Description
  1. Look for the code that generates you meta description data, it should look something like this;


  1. What we are going to do here is add the page title tag so that this meta data is at least partially unique.

  2. Change this code to read;

content="<{$xoops_pagetitle}>, <{$xoops_meta_description}>" 

Page Title Component Order
  1. Look about a dozen lines down from the top for a line that looks like this;

<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title> 

  1. This is the code that generates the page title for each page, and the problem here is that the site name comes first meaning that page titles are always going to begin the same and will look like duplicate data to Google. What we are going to do here is reverse the position of the two tags so that the page title tag which is unique under most modules comes first

  2. Change this code to read;

<title><{$xoops_pagetitle}> - <{$xoops_sitename}></title> 

Page Title In H1 Tags
  1. Move down past the items contained in the head tags and look for a line that looks like this;


  1. Then immediately after it add the following;


  1. By doing this we are placing the page title in the largest heading tags there are making it more prominent to Google, without actually printing the page title to screen.

Creating Logo Image ALT Tag
  1. Look for the line of code that displays your websites logo. It should look something like;


  1. Add a new alt tag, or modify the existing one so that it looks like;


Creating Link In Footer Using Page Title
  1. Scroll to the bottom of your theme.html file, and look for the following tag;


  1. Directly after this tag, or on a new line (personal preference) add the following;

<a href="<{$xoops_url}>" target="_self"><{$xoops_pagetitle}></a> 

Page Title Generation

This brings us to modules now, and the way in which they actually generate the page title which is passed onto the page title smarty tag that we used in the theme. This is a lot more complex than modifying the theme for several reasons.
  1. Not all modules actually generate page titles, meaning that code will need to be added to do so.

  2. Generation of individual page titles is done on a per module basis, so there is no one central point where this can be modified.

  3. Requires some knowledge of PHP to do.

This is a little more advanced than I am looking to go in this guide, but there is an excellent tutorial on this over at I have made modifications for AMS, CBB 1.x, MyDownloads, MyLinks, Xoopspoll and SmartFAQ and have added them to my downloads section here for others to use.


SEO and monetizing your website is a massive world that is never fully conquered, and will always keep you on your toes. There are many out there that claim their optimisation practices are best, and although they usually follow similar fundamentals that will make a difference (such as those covered in this guide), the art of fine tuning is something that has to be done largely on a trial and error basis for each web site.

Using the same techniques in this guide and applying them to this very site, the number of referrals from the Google search engine this month is on target to be over 300% of that from just 2 months ago. The ads being delivered by Google Adsense are also a lot more relevant, and last month revenue jumped by 436% over the previous month. Have a browse through the site and see for yourself how relevant ads are to the content being displayed. Compare this to an Xoops website with very little optimisations in this area, and it is a completely different story. I know for a fact this site is now earning a very comparable amount to other Xoops sites with no optimisation that are getting more than 10 times more traffic than here. Definitely shows that optimising Xoops can bring about some rewarding results.
Postar um comentário