CONTACT US: 1-800-622-4403
ABOUT    CONTACT SALES    SERVICE AREAS
Domains To Datacenter Since 1994

Masking Your Email from Spammers with WordPress + PHP

Overview

If you are on WordPress, you can consider using the built-in antispambot() function to encode your email address. The function will encode the characters in your address to their HTML character entity (the letter a becomes a and the @ symbol becomes @) though they will render correctly in the browser.

<?php echo antispambot("john@abc.com"); ?>

This will result in the email address being displayed on your website in a readable format.

However, the bots that are trying to harvest email from your HTML source will see html codes that do not display as a readable email address.

How to Accomplish This


Here is one way to accomplish the above.
  1. Install the WordPress plugin "Shortcode EXEC PHP".  This will allow you to create your own custom shortcodes that contain PHP code.

  2. After installing Shortcode EXEC PHP, create your 5 PHP code snippet by navigating to tools >> Shortcode EXEC PHP in WordPress

  3. Enter the PHP code to use the built-in antispambot function

    echo antispambot("john@abc.com");

    Note: When using Shortcode EXEC PHP, you do not need to include the <?php beggining and ?> end tags.

  4. Name your new shortcode

    Example [myemailaddress]

  5. You can now edit the page where you would like the email address to appear --simply adding the shortcode [myemailaddress] to the page.
Your email address will now be visible on the page.


Websites

  1. How To Install WordPress
  2. Hosting Multiple Domains on One IP Address (SuperAccount)
  3. Where can I find the FTP information for my POA account?
  4. How to modify CSS on Mobile Devices
  5. How to generate a CSR, purchase & Install the Certificate in the POA System
  6. Change Your Domain Name using WordPress
  7. How to enable .NET 4.0 for your POA Account.
  8. How to remove Pages/Posts from Wordpress Search
  9. How to disable all Wordpress plugins using MySQL
  10. Remove index.php from Wordpress URL
  11. How to move a Drupal site from one host to another
  12. How to move a Wordpress site from one host to another
  13. How to change the Wordpress site URL
  14. Masking Your Email from Spammers with WordPress + PHP
  15. How to Redirect a Registered Domain
  16. Changing the Wordpress URL Path to web root "/" or another path
  17. Simple Way to Secure a WordPress Website
  18. How to restart your website in Control Panel.
  19. How to Block Referral SPAM from your Website
  20. Creating Campaigns in Google Analytics
  21. Switching over to a New InfoQuest account.
  22. Stopping your website through the customer control panel.
  23. Deleting a domain from your account.
  24. Where do I go to view my web stats (AWStats) for my site?
  25. How to change Wordpress siteURL to IP address using phpmyadmin
  26. How to enable "anonymous access" to browse my site.
  27. How to access Wordpress files.
  28. How to add a dedicated/exclusive IP address to your account.
  29. How to upload website content to the server.
  30. Update Directory Path for Website.
  31. Password protecting a folder on your site on POA.
  32. Add Structured Data Location Schema to your website
  33. How to delete WordPress Comments using phpmyadmin
  34. How to password protect a specific directory on your POA Hosting Account.
  35. What's New in Wordpress 4.9

Feedback and Knowledge Base