This tutorial shows you how to display Google Adsense ads on your Joomla! 1.6.x website without installing an extension.
Requires you have a Google Adsense account. Should work for other ad providers that provide you with a code snippet for ads on your site.
Joomla! 1.6 is now obsolete and Joomla.org no longer provides support for it.
The instructions are the same for Joomla! 1.6 and Joomla! 1.7 – except that Joomla! 1.7.0 has compatibility problems with at least IE 8 (and possibly other browsers). Read the updated instructions for Joomla! 1.7 here.
Some images may be clicked for larger sizes.
It is very easy to place Google Adsense ads on your Joomla! site without installing an extension.
Yet, the last time I looked, there were dozens of different Joomla! extensions to help you with Google Adsense ads on your site.
Embedding ads directly within your article requires a plug-in and is not covered by this tutorial.
Determine Ad Placement
You need to find a place for the ads on your site.
Ads are typically placed at the:
- top of the page
- bottom of the page
- side of the page
See this article on how to enable Joomla 1.6 to display module positions.
To reveal the module positions available in your Joomla! template, append
to the end of your URL. As shown below, the various module positions available on this site are revealed:
You can choose to place ads in a currently empty module position, for example: position-6, position-8, position-3, position-0, position-12, position-2 , position-9, position-10, position-11 or position-14 in the case of this template. Or you can place them in already occupied module positions, for example, position-5.
Where you place the ad will determine the type of ad you place. For instance, if you choose to place an ad on the left position, then a narrow and tall ad makes more sense than a short, wide ad.
Remember the name of the module position where you want to place your ad.
Disabling the HTML Editor
Joomla! tries very hard to prevent users from entering malicious code. This also means it prevents adding legitimate code. To get around this we need to disable the HTML editor.
1) Select Global Configuration from the Site menu item:
2) Select Editor – No Editor for the Default WYSIWYG Editor:
3) Click on Save & Close to save the changes:
After you are done, you can restore the editor to the TinyMCE editor (or which ever editor you were using).
4) Select Article Manager from the Content menu:
5) Select the Options icon:
6) Click on the Text Filters tab:
7) Scroll down to Super Users and select No Filtering from the dropdown box.
NOTE: this step assumes you are logged in as an administrator and thus have super user privileges.
8) Scroll back up and click on Save & Close:
After you are done, you can restore the option to Black List (default).
You require an Adsense account.
You also need the HTML code Google will provide you for your ad.
1) Select Module Manager from the Extensions menu item.
2) Click on New to create a new module.
3) Click on Custom HTML:
4) Fill in the module information.
- Title: enter a title for this module. If you want to display the title, something like Sponsored by is a good choice.
- Show Title: select Yes to display the title, No to not display the title.
- Position:·from the dropdown list, select the name of the module position you decided on when determining your ad placement
- Status: set to Published to show / display the module.
- Access: ensure Public is selected.
- Order: if there are other modules occupying your selected position, you can choose the ordering of the modules.
- Start Publishing: leave empty.
- Finish Publishing: leave blank
- Language: leave as All.
- Note: optional note to display in the module list.
This is where you paste the HTML code that Google Adsense gives you.
Advanced Formatting Trick
It is likely that the ads will be left justified in the module position.
You can horizontally center the ads by adding
before the HTML code Google Adsense gave you and adding
at the end of the Adsense code.
Ensure On all pages is selected. This will place the ad module on all pages of your Joomla! site.
If you want some pages to be ad free, then select one of the other Module Assignment options (No pages, Only on the pages selected, or On all pages except those selected) and then select only those pages were you want the ads to appear or not appear.
5) Click on Save & Close
6) Observe that the module has been correctly installed. To locate the newly created module, I find it easiest to click on the ID column and sort the column in descending order:
7) Check that the ads show up and are correctly positioned on your site (in this case, I created a single Adsense module in position-10:
Please consider sharing this article if you liked it or found it useful.
You may use one of the buttons below or share using your own favourite media.
Please do not republish this article on your website. You may publish a short excerpt and provide a link back to the original article.