Obfuscate e-mail addresses in text and links via random hex and ASCII code substitution while retaining the appearance and functionality of hyperlinks.
Example (of full obfuscation):
Would be translated into something like this:
However, in your browser it would appear to you as it does prior to obfuscation, and the link for the e-mail would still work. Theorectically, however, spammers would have a somewhat more difficult time harvesting the e-mails you display or link to in your posts.
- Download the file obfuscate-email.zip and unzip it into your /wp-content/plugins/ directory.
Copy and paste the the code ( obfuscate-email.phps ) into a file called obfuscate-email.php, and put that file into your /wp-content/plugins/ directory. Please ensure you do not introduce any spaces or other characters before the <?php or after the ?>
- Optional: Change configuration options in the file to your liking. In-code comments should help you there.
- Activate the plugin from your WordPress admin ‘Plugins’ page.
function c2c_obfuscate_email( $text, $encode_everything = 1 )
- $text : Text to be scanned for e-mail obfuscation
- $encode_everything: optional; if 1 then full obfuscation (as seen in the Notes section) will occur. If set to 0, then only very minimal obfuscation occurs, i.e. «@» gets replaced with
@and «.» gets replaced with
(See notes section above)
- 24 Mar 2005 : v0.9 — Released to the public
Copyright (c) 2005 by Scott Reilly (aka coffee2code)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.