hide email address from the markup on your site

PHOTO EMBED

Thu Jul 22 2021 21:31:28 GMT+0000 (UTC)

Saved by @Alz #php

// Hide email address from the markup on your site.
// use by putting each email address in shortcode like this: dude@example.com
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');
content_copyCOPY

https://borishoekmeijer.nl/tutorials/wordpress-snippet-collection/