Possible to add Shortcode into the URL Field?

Hello, I’m wondering if it’s possible to add in a shortcode into the URL filed as seen in the screen shot here … I’d like to add in the ASE Pro email obfuscation feature, which of course uses a short code.

Or, if it’s not possible:

  • Is there another way to obfuscate my email?
  • Is obfuscating it even really necessary?

TIA!

that wont work and not a clean/good way to do it as well.

easiest way to solve it is base64

encoding:

for the link:

<a class="email" href="bWFpbHRvOmpvaG4uZG9lQGV4YW1wbGUuY29t">am9obi5kb2VAZXhhbXBsZS5jb20=</a>

this is this btw:

<a class="email" href="mailto:sinan@sinanisler.com" >sinan@sinanisler.com</a>

yes you need to encode mailto: with the mail :slight_smile:

for decoding js run this on footer need to run a bit late or wont work well:

<script>
window.addEventListener("load", (event) => {
  let emails = document.querySelectorAll(".email");
  for (let email of emails) {
    try {
      email.setAttribute("href", atob(email.getAttribute("href")));
      email.innerText = atob(email.innerText);
    } catch(e) {
      console.error("Decode error:", e);
    }
  }
});
</script>

add .email class to your mail links selector directly selects .email but you may want to change the js selector to “.email a” depending on yourelement…

https://codepen.io/sinanisler/pen/raeoovK

1 Like

i dont think it will work!

Thank you. Looks like a brilliant solution that I never would have thought it.

I’ll give this a shot!

you are welcome :+1:

this methodology industry standard

cloudflares solution is same too
only difference is they use much much stronger cryptographic custom encoding and decoding :slight_smile:

https://codepen.io/sinanisler/pen/raeoovK

1 Like