WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] mailto: link issue (5 posts)

  1. pshero
    Member
    Posted 5 years ago #

    Ok gang, I've got a client using WP as a CMS as he wants to add his email to the contact page in link format. Before you say anything, I've already given him "the speach" about the risk of spam and I'm entering the email addy as unicode to help prevent the problem. The issue is that even though I'm correctly setting the href in the page like this (and yes, I'm using the HTML editor, not the VISUAL editor):

    a href="mailto:user@sample.com"

    WordPress somehow adds the site's url to the front of the link so on the actual page it displays like this:

    a href="http://theblogurl.com/mailto:user@sample.com"

    Why the hell is WP adding my site url to the front of an outgoing link? I also notice if I use a url without the http:// prefix that it does the same thing.

    Does anyone have a workaround or a solution for this?

  2. mikey1
    Member
    Posted 5 years ago #

    Hi there, I've never found a way to obfuscate the email address on a page, but I use the easy contact form plugin,which can place a form on any page or post, and of course the email address is invisible on the form.
    http://www.plaintxt.org/experiments/easy-contact/
    Once activated simply add [easy-contact] to any post/page.
    I'm impressed with this plugin because I have it working in wordpress 2.5.1 2.6 and even 2.7 beta3
    hope it helps.
    Mike.

  3. pshero
    Member
    Posted 5 years ago #

    Thanks for the reply mikey1, I'm using a contact form in the page but the client wishes to have a mailto: contact link in the page and that's what's causing the problem.

  4. buddha trance
    Member
    Posted 5 years ago #

    Strange, I just tested adding a mailto link right under the contact form (I am using easy contact, like mikey1), on my local test install... and it works.

    <a href="mailto:user@sample.com">email me</a>

    Which contact form are you using?

  5. pshero
    Member
    Posted 5 years ago #

    After two hours of fiddling I've figured out that it was actually the UTF encoding that I was using (or rather the specific encoder) that was causing the issue. Thanks to both of you for helping out.

    Buddah Trance, it was your test that actually sent me in the right direction. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic