WordPress.org

Ready to get started?Download WordPress

Forums

how do i add antispambot to mailto? (14 posts)

  1. francisx
    Member
    Posted 7 years ago #

    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?

  2. Chris_K
    Member
    Posted 7 years ago #

    I'd like to help, but I'm not sure exactly what we're trying to do. What's an antispambot?

  3. francisx
    Member
    Posted 7 years ago #

    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

  4. francisx
    Member
    Posted 7 years ago #

    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

  5. francisx
    Member
    Posted 7 years ago #

    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...

  6. moshu
    Member
    Posted 7 years ago #

    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.

  7. francisx
    Member
    Posted 7 years ago #

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

  8. moshu
    Member
    Posted 7 years ago #

    Not with a WP tag.

  9. Samuel B
    moderator
    Posted 7 years ago #

  10. Chris_K
    Member
    Posted 7 years ago #

  11. francisx
    Member
    Posted 7 years ago #

    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.

  12. moshu
    Member
    Posted 7 years ago #

    i guess they're for emails in posts mostly.

    And where would you like to use it?

  13. francisx
    Member
    Posted 7 years ago #

    in the body of the about page

  14. saltlakejohn
    Member
    Posted 7 years ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Topic