Support » Fixing WordPress » how do i add antispambot to mailto?

  • i’m a little dense, i can’t seem to figure it out. i’ve read the few posts out there on wordpress, and a few more on other sites. nothing helps.

    the code i’m using currently is this:

    < a title = ” name @ yahoo . com ” href = ” mailto: name @ yahoo . com ? subject = Blog ” > name @ yahoo . com < / a >

    which works fine but how do i add the code for the antispambot?

    i read this but it didn’t help…

    “I have a client that wants to have an email link on a post. Not on every post. Insted of using this code in the loop : < br / >
    < a > ” &gt ; email author < / a > “

    this didn’t work

    < a > ” & gt ; email author < / a >

    can anyone help?

Viewing 13 replies - 1 through 13 (of 13 total)
  • I’d like to help, but I’m not sure exactly what we’re trying to do. What’s an antispambot?

    it’s a string that’s added to embedded email addresses in webpages and blogs to keep spammers from being able to “troll” them.

    for instance, if i have a link in my blog like “mailto:youremail@yahoo.com” theoretically some troller could pick it up and use is as a resource. apparently this is so common that many sites, including wordpress, have instituted an “antispambot” mechanism to foil them. it is a string that precedes the actually email address in the html code that, i think, bounces it to somewhere else first, tehn on to its original destination.

    here are some examples:

    “>email author” without the quotes

    “>email author” without the quotes

    here’s a post that explains the antispambot thing…
    http://codex.wordpress.org/Template_Tags/the_author_email

    it’s a string that’s added to embedded email addresses in webpages and blogs to keep spammers from being able to “troll” them.

    for instance, if i have a link in my blog like “mailto:youremail@yahoo.com” theoretically some troller could pick it up and use is as a resource. apparently this is so common that many sites, including wordpress, have instituted an “antispambot” mechanism to foil them. it is a string that precedes the actually email address in the html code that, i think, bounces it to somewhere else first, tehn on to its original destination.

    here are some examples:

    < a href=”mailto:<?php echo antispambot(‘author@xyz.org’); ?>”>email author</ a >

    < a href=”mailto:<?php echo antispambot($author_email); ?>”>email author</ a >

    here’s a post that explains the antispambot thing…
    http://codex.wordpress.org/Template_Tags/the_author_email

    this is the best post i found but i can’t figure out how to use it. i’ve tried it a zillion ways but none work…

    http://wordpress.org/support/topic/36268?replies=8

    jbbrwcky’s post is most relevant but i can’t get it to work. i’d also like to add content in the subject line…

    As it is seen in the Codex page you linked above – that thing works only with the email address(es) registered as admin and/or author email address. Not with other addresses.

    there must be a way to this with other email addresses, n’est-ce pas?

    Not with a WP tag.

    i tried both and the other one obfuscate email. none of them seem to do the trick. i guess their for emails in posts mostly.

    thanks for looking into it.

    i guess they’re for emails in posts mostly.

    And where would you like to use it?

    in the body of the about page

    As old as this thread is, I imagine these people have all found answers or work-arounds by now. But I’m still going to offer two possible ways to lightly obfuscate email addresses that turn up in text. Antispambot converts random characters from the email address into HTML character codes: &#64;, for example instead of @.

    If you can embed PHP into your posts (you’ll need a plugin to set that up for you), then your anchor link will look like:
    <a href="<?php echo antispambot( 'mailto:john@example.com' ) ; ?>">

    But if you cannot embed PHP (there are good reasons to keep your plugin overhead low), then simply convert the email address to HTML character codes somewhere off site and cut-and-paste the resultant string into href=” ” between the quotes like this href=” &#109;&#97;&#105;&#108;&#116;&#111;:&#106;&#111;&#104;&#110;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;” which I got from this encoder.

    An alum at The University of Arizona offers you the encoding and a clever little javascript interpreter, if you want to use javascript. Embed the whole thing, unless you need to do it a lot.

    <script type="text/javascript" language="javascript">
    <!--
    // eMail Obfuscator Script 1.31 by Tim Williams - freeware
        {     document.write(String.fromCharCode(60, 97, 32, 104, 114, 101, 102, 61, 34, 109, 97, 105, 108, 116, 111, 58, 106, 111, 104, 110, 64, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 34, 62, 74, 111, 104, 110, 60, 47, 97, 62))
         }
    //-->
    </script>
    <noscript>
    </noscript>
Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘how do i add antispambot to mailto?’ is closed to new replies.