// Hide email address from the markup on your site. // use by putting each email address in shortcode: [email]dude@example.com[/email] function encode_email_shortcode($atts, $content = null) { for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';'; return '<a class="encoded-email" href="mailto:' . $encodedmail . '">' . $encodedmail . '</a>'; } add_shortcode('email', 'encode_email_shortcode');
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter