Ready to get started?Download WordPress


How to shroud an email address to prevent spam (35 posts)

  1. Ihor Vorotnov
    Posted 1 year ago #

    Eek! target="_blank"?

    Yeah, this is something I'm trying to figure out for a long time. First of all, a button saying 'Send me an email' is logically a "new window action" as it will open a mail client. For external apps _blank will be ignored. For those who set Gmail (or other webmail) to handle mailto: links in the browser without _blank it will be loaded in same tab/window replacing the site, which is not a logical and expected behaviour. With Gmail it looks really bad. Clicking mailto: link opens in current window/tab a blank page with Gmail's 'compose' overlay div and after sending the message this overlay is automatically closed leaving you in front of a blank page. Awkward. But wait, that's not all! When you hit browser's back button you see a 'compose' overlay again instead of going back to the site. What most users will do in this case? Close the tab/window. This is not a user-friendly behavior. I think that 'Contact me' link is not an internal/external LINK to be followed, it's an external ACTION, which by default will be handled in separate window (external application or webmail in external window) or it can handle an overlay with contact form..

    the alt must replicate the text rendered in the graphic

    It makes no sense for me, really. Looks like just stupid following some strict rule, not thinking about the end user but about getting 'WCAG Passed' badge. First of all, the button is not a graphic, it's a PLAIN TEXT link 'Contact me', it is a text and it is accessible. The alt attribute, as I understand, gives alternative readers some extra information - explanation, instruction etc. Replicating 'Contact me' text in alt attribute makes no sense because it doesn't help and it's actually redundant, because the link text is accessible itself. Alt text here is kinda optional instruction for alternative reader. What am I missing?

    have you tried putting your theme through the theme accessibility audit yourself?

    Not yet, until now I developed themes only for personal projects and clients. Right now working on my first theme to be released in public and will definitely try this out. Thanks!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    this is something I'm trying to figure out for a long time.

    Why not let the user decide what to do? People can chose to open a new tab/window via their browser if they want. The problem here is that you will be stranding a specific group of users who will no longer be able to return to the site.

    First of all, the button is not a graphic, it's a PLAIN TEXT link 'Contact me

    Sorry - yes. I confused with an earlier scenario that described using a graphic as a way of embedding an email address into a page. But the obfuscation that you've used on the mailto is really very simple and is going to be parsed by all but the dumbest of harvesters.

    Also, you cannot add an alt attribute to a text link. By W3C's definition, the alt attribute is for visuals (images) only. You could replace with with the title attribute but I don't see there's a need for it here (it's unwise to rely on title attributes anyway - for various reasons).

    As a text link, it's perfectly accessible if you drop the `target="_blank" but I don't think it will have much effect on reducing your spam levels. If a browser can parse it, you can virtually guarantee that most spam bots will be able to parse it as well.

  3. Ihor Vorotnov
    Posted 1 year ago #

    The problem here is that you will be stranding a specific group of users who will no longer be able to return to the site.

    Actually, I don't see where I have this group of people in my scenario. They will close a tab/window with webmail and return to my website's tab automagically - most browsers with default settings after closing a tab return user to previously active tab. I explained you a Gmail scenario without target="_blank". In this case we really get this group of users who will no longer be able to return to the site, because we already navigated 2 steps from the site.
    I've chosen a 'logical' approach to follow. The link looks like a button on purpose (and of course it's pure CSS, no images). Buttons are meant to behave differently, not like inline links. Buttons perform actions, not just leading to another page. They open external application, spawn modal windows and layers, open new tabs and windows. These behavior is logical. And this behavior must be consistent. If it opens external mail app when it's assigned by the user in browser prefs, it should open webmail in the same fashion - in new window. Same if you use contact forms. In this case a 'Contact us' button should open a pop-up div with a form, not going to 'Contact us' page with this form attached somewhere on the page.

    You are right about alt attribute for links. My bad. Just checked W3C specs, and everything seems logical. Alt for images, in my case I will use title attribute. W3C states:

    This attribute offers advisory information about the element for which it is set.

    which is what I need. And it displays as a tooltip, which is great. This way, a user hovering the button will see the text 'Send me an email'. It's even ok to extend the message, saying 'Click here to send me an email in new window or your default mail app'. It's a perfect solution for visual browsers. But what about touch devices? Keyboard only? Screen readers can implement this differently. Other devices too. No standard again. As you said, it's unwise to rely on them.

    And regarding spam level. Sounds fair, that If a browser can parse it, you can virtually guarantee that most spam bots will be able to parse it as well, but as I wrote above, we did a test. 2 new emails on the same website. One was obfuscated using same technique, the other one plain. After 6 months those emails had different amount of spam received, and the difference was huge. That means, even if harvesters can do this in theory, in practice seems like they are not doing. In russian/ukrainian language there is a proverb: "If you are afraid of wolves - never go to the forest". Same story here :) Obfuscation obviously protects, not 100% but significantly. Paired with a quality email service like Gmail with their solid SPAM filtering you can sleep well and don't worry about being spammed.

    There's no way to live completely without spam. As I also wrote, even if you don't advertise your domain-based emails it's pretty easy to guess them. Choose 10 random domains, send emails to info@that.domain.name and 9 of 10 letters will be delivered. If you shared your email with anyone (subscribed to any newsletter or registered on any website) there's always a chance their database will be hacked and stolen. Then your email will be definitely in all SPAM databases and marked 'reliable'.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Actually, I don't see where I have this group of people in my scenario.

    They're called switch users - often physically impaired users who effectively use a single, two-state input device. You can emulate the issues that they have to face by limiting yourself to just the tab & enter keys on the keyboard and nothing else. No mouse. No cursor keys. Nothing. Now try moving around a page and selecting a link that opens in a new window or tab. The focus will immediately switch to the new tab and you will not be able to use the browser's back button to get back to the original page. so how do you get back to the original page again? Remember - no cheating and using a mouse or any function keys.

    These are the kinds of issues that disabled users face every day.

    As for title attributes, you cannot rely upon them. They are not rendered in all user agents. The switch user or the voice recognition user (for example) will never see title tooltips. Ditto touchscreen users. And because the title attribute is so badly abused under the guise of "SEO", most screen reader software is configured to also ignore them. so your visually-impaired screen reader users won't get to hear it either.

    At the end of the day, I consider my spam to be my problem. I have tools that I can use to effectively filter out more than 90% of all spam I receive. What I will never do is try to alleviate my problem by making problems for others - such as obfuscating an contact address.

  5. Ihor Vorotnov
    Posted 1 year ago #

    Ok, got your point.
    By the way, mailto: links are handled differently by browsers and target attribute is completely ignored. So, there's no way to open it in new tab. I thought I had a bug with Gmail only, but with some more testing I found out it's just not possible. Mailto links to webmail services will always open in current tab, enternal mail programs will launch in their own separate windows.
    And Gmail still produces this bug with history. If is filed as a bug in both Firefox and Chrome support threads but still not fixed.

Topic Closed

This topic has been closed to new replies.

About this Topic