As soon as you put an email address on to a web page it becomes subject to 'harvesting'. Spammers use the same technology as search engines to crawl the web looking for email addresses and your sparkling new website is as good a place to find them as anywhere.
But you can stop them. All you have to do is not put your email address on the page!
Javascript runs on the visitor's browser and it can be used to create content on the fly. If you replace the 'mailto:' email link with a small javascript function that builds the link right there in the browser, all the spammers find on your webserver is a piece of javascript and their harvesters aren't clever enough to execute javascript. Not yet anyway!
PanPage includes a javascript function called nsmhere() (nsm = 'no spam mail') and you can include it in both raw/HTML and StdText Items.
Copy the javascript code from the box on the right and paste it directly into a Raw/HTML Item.
Copy the code from the box on the right, click the 'HTML' button in the Edit Item form and paste into the HTML window. Click Save to return to the WYSIWYG item editor. You won't be able to see anything there because the item editor doesn't execute javascript either, but it will appear on the web page when you view or preview it.
If you're not using a PanPage theme you'll need to ensure that the javascript file, pp_top.js, is included in your page file BEFORE the point where you need to call nsmhere(). pp_top.js is located in the cms folder and it's normally placed in the head section of your page. PanPage themes already include pp_top.js.
Replace xx-address with the first part of the email address - the bit before the '@' symbol.
nsmhere() supplies the domain part of the email address - it assumes that's the same as the website it's running on. If you want to include an email address based on a different domain there is another function, nsm(), that will do that - see the PanPage Design Guide for details.
The function nsmhere() is contained in pp_top.js (in the cms folder) so, if you've not already done so, load pp_top.js file in your page file's head section...
[ select all ]