hide email address from the markup on your site

PHOTO EMBED

Thu Jul 22 2021 21:31:28 GMT+0000 (Coordinated Universal Time)

Saved by @Alz #php

// 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');
content_copyCOPY

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