Sad though it may be, it can be dangerous to publish your email address online because your privacy is then destroyed (and you’ll be receiving a lot of junk mail moving forward).
The typical way of getting around this is by providing a contact form, where the email address is hidden from the end user. However, there are times when it would be useful to display the email address without the risk of spiders and email harvesting software from picking it up.
WordPress has a built-in function for doing just that, called antispambot().. You can pass any email address to this function and it returns the same email address, but encoded in HTML entities. This makes it harder for harvesting software to recognise it as an email address, but still displays completely normally to the end user.
Since it’s a WordPress function, you can either build it into your theme files, or you can create a shortcode to wrap email addresses to use it within posts, pages and widgets. To do that, drop the following snippet into your functionality plugin:
By way of example, using email@example.com inside that shortcode looks normal on the front end, but when you look at the page source (which Google and crawlers etc. read), you’ll see that it’s far from recognisable as an email address:
This is a great way to make your email address public, without making it public, if you know what I mean.