The spam email can be regarded as a huge trouble for many webmasters. Also known as junk mail or unsolicited bulk mail, it is the electronic spam containing the same content sent to a large number of webmasters. If people click on the links involved in the email, they will be directed to a phishing site or a website including malware.
Generally, the spam email is offensive, causing some security issues or potential vulnerabilities to the website, especially for the e-commerce site. Now, you may be wondering how to prevent spam emails effectively. In the following, we have listed some useful methods helping you achieve your goal with ease.
Method One: Email Encrypting
This method is one of the most effective ways to protect your website away from spam email. By encrypting your email, no spammers can scan your WordPress site for getting the email address, reducing the possibilities of spam email to the largest extent.
To do this, you can make use of some powerful and user-friendly WordPress plugin. Here, we highly recommend CryptX. It is very easy to use, handle, and configure. With it, your email address can be automatically scrambled so that spammers can’t harvest your mail.
In the very beginning, you need to download, install, and activate this tool. You can do this from WordPress.org, but we suggest you doing this from your WordPress admin panel. You only need to go to WordPress dashboard < Plugin < Add New. Then, you can enter CryptX into the search box and click the Search Plugin button. Next, you can see a list of related plugins in the following screen. Find your target and click on the Install button. After activating it, you can use it immediately.
Now, you can go to the setting tab to find this plugin for configuration. Under the Presentation tab, you can choose custom characters with the “at” sign and the “dot” sign. Also, you are able to scramble your email address with AntiSpamBot or simply change the mail to an image with the PNG format.
Now, you can go to the General Setting to apply CryptX to anywhere you want, including content, custom fields, excerpt, comments, and widgets. We suggest you choosing all of these options.
In fact, you can also encrypt your email address by adding some lines of code into your template directly. We have already come out the coding stuff. You only need to copy and paste in into the function.php file of your WordPress theme, along with the parameter of your own website values.
Method Two: WordPress AntiSpamBot Function
According to WordPress Codex, WordPress has a default anti-spam function that is called AntiSpamBot. This in-built feature can prevent spam bots by converting the characters of your email address to the HTML entities. To enable AntiSpamBot, all you need to do is to paste the following lines of code at anywhere within your WordPress theme.
<?php echo antispambot( 'email@example.com' ); ?>
You can also use this function in your widget with a new text widget. To do this, simply go to the Appearance tab of your WordPress admin panel, and click the Widgets option. Then, you can drag and drop the Text Bar into anywhere you want within the sidebar to create a new widget. Then, add the following coding into the widget content.
add_filter( 'widget_text', 'shortcode_unautop' ); add_filter( 'widget_text', 'do_shortcode' );