How To Combat Spam on Your Joomla! Website
In this tutorial we will look at how to add contact information to your Joomla! site, while keeping spam out of your inbox. While that seems simple on the surface, it can lead to a major problem if you aren't proactive about spam.
Simple, But Not User Friendly, Spam Solution
A simple way of dealing with spam is to create a mailto: address that looks like this:
yourname AT yoursite DOT com
It works in fooling the spam bots but it's not very friendly for visitors (nor will most people take the time to copy the email address, fix the text, then manually send you an email). So much for user interaction!
How to Kill Spam Using Obfuscation
Another way is to use a technique that was developed by one of my colleagues, a fellow by the name of Jeff Mulligan.
As Jeff states on this page, a major source of the spam you may be getting will come from your own websites. The way to deal with it is to use Jeff's spam killer which obfuscates (i.e. hides) your email address so it's visible in a browser, but the spam bots can't read it.
The beauty of this system is that it doesn't use JavaScript, but uses ISO hexadecimal notation, instead.
As an example, I'll use the fictitious email address: myname@yoursite.com. This is what it looks like in ISO hexadecimal notation:
<a href="mailto:myname@yo&#
117;rsite.com">myname@yoursite.com</a>
and here's what it would look like on a web page:
You can easily insert this code into your website and it will reduce your spam problems.
Joomla! Contact Forms Using the Alf Contact Extension and Gotcha
The third option is to install a contact form, preferably one the a captcha option. The first step is to go to the Joomla! Extensions directory and do a search for contact forms. This returns 427 results. To drill down, click on the Advanced Search link beside the Search button and enter the following:
In the search field: contact forms Search by Compatibility: 1.5 native Search by Type: Non-Commercial
Click on the Search button. This returns 91 results. From these I chose the Alf Contact which has 114 votes, a 4.5 star rating and 77 reviews. Note that this extension comes with two files which are necessary if you want to make use of the captcha option.
One really nice thing about this extension are the two installation videos. Those make it easy to configure the extension.
When you download the extension, go to Extensions: Install/Uninstall. Browse for the two files: plg_bigocaptcha-1.2.zip and com_alfcontacct_v193.zip and install them.
Once that's done, go to Extensions: Plugin Manager. Look for the header: System - BigoCaptcha. If it's not visible, go to the Select Type drop down list on the far right of the page and choose System. This will bring up System - BigoCaptcha, which is currently disabled. Click on the red "X" to activate it.
Next, go to the Components menu. You'll see Alf Contact at the top of the list.
This brings up the My Contacts page. Click on the New button.
This brings up the Contact - New page. In the fields enter:
- Name: The name of the person who will receive the messsage
- Email: Their email address. This is hidden from the users
- Prefix: This can be used in front of the subject and it can also be used to act as a filter, to direct mail to different folders
- Optional Field: This is for additional information, such as a phone number. If you don't want this box to show, leave it empty.
- Default Subject: If there's a default subject you wish to use, enter it here.
Finally, set Published to Yes and choose which access level you want to use. Save the information.
Note the following information in the My Contacts page.
Now we'll look at some addtional parameters. Enable the checkbox beside the contacts name you just created and click on the Parameters button at the far right. In the window that opens, there are other settings that you can take advantage of, such as adding in a title, a message in the header or footer, choosing to use a different captcha, and more. To use the Bigo Captcha, enable the Captch option and choose Bigo captcha. When you're done, click on the save button.
Now we're ready to assign the contact form to a module. In this case, I'll use the Main Menu.
Go to Menus: Main Menu.
In the Menu Item Manager page, click on the New button.
In the Menu Item [New] page, click on AlfContact.
In this new Menu Item [New] page, enter:
Title: Contact Us Display In: Main Menu Parent Item: Top Published: Yes
On Click, Open In: Parent Window with Browser Navigation
Note the statement: New menu items default to the last position. Ordering can be changed after this menu item is saved.
Note the postion of the Contact Us menu item, which will be in the last postion on the main menu. If you want a different position, enter a number in the Order parameters box, then click on the Save Order icon at the top of the Order list.
Refresh the frontend. Note the position of the Contact Us link in the Main Menu.
Now, click on the Contact Us link. Note the position of the Contact Us form with the captcha active.
This covers the basics of how to add contact information to your Joomla! site while being proactive about spam. The last option we presented is one of the simplest methods. If you want more options, they are available in the extensions section of the Joomla! website.