Stop iPhone from (Incorrectly) Auto-Linking Phone Numbers

One of the many nice features of iPhone is that Mobile Safari will auto-detect any phone numbers on a web page and turn them into links. Very handy. Much better than remembering the number as you switch from the browser to the phone.

However, this auto-detection is a bit overzealous. In addition to phone numbers, I’ve seen it link date ranges (1978-2008), specific dates (3/9/2009), and—for us baseball stat geeks—offensive rate statistics (.312/.418/.515… and I’ll send a BatchBlue tee shirt to the first person to identify that sweet career line).

Tonight, I was building a page and tested it in iPhone. It incorrectly linked some dates. This was problematic because in that specific section, I had all anchors set to display: block;. So, adding these extra links broke the design.

I could have added some extraneous markup and worked around it, but I was curious if there was a way to turn off this auto-detection. Turns out, there is.

In your <head>, add this line:

<meta name="format-detection" content="telephone=no" />

That will turn off ALL phone number auto-detection on that page. Enjoy!

17 Comments

  1. On March 31st, 2009 at 8:59 pm Craig Jolicoeur said:

    That would, of course, be the one and only Edgar Martinez.

    Nice iPhone tip as well :)

  2. On March 31st, 2009 at 9:07 pm Adam Darowski said:

    Yes sir! You and a Twitter pal got it at about the same time. I’ve DMed you asking for an address. Thanks! :)

  3. On April 1st, 2009 at 2:33 pm Greg said:

    Thanks for the link love. Glad my original post/comment came in handy.
    Follow me @graiz

    - Greg

  4. On November 17th, 2009 at 3:37 pm Tom said:

    Just what I was looking for, thanks!

    It’s interesting that the iPhone Safari is so willing to auto-link common non-phonenumber formats, such as the standard MM/DD/YYYY date.

  5. On November 17th, 2009 at 3:40 pm Tom said:

    Woops, meant M/DD/YYYY.

  6. On March 14th, 2010 at 12:06 pm Sam Marsh said:

    Any ideas on how / whether you can change the way iPhone decorates the telephone link? I don’t seem to be able to overide this by text-decoration: none etc.

  7. On March 14th, 2010 at 4:56 pm Sam Marsh said:

    I’ve come to the conclusion that using &shy; to prevent iPhone reading the digits as a telephone number is the best workaround at present…

  8. On March 15th, 2010 at 9:32 am Adam Darowski said:

    Hey Sam (I fixed your comment… darn code samples!),

    Thanks for the tip. Soft hyphen, eh? Never used it. Interesting.

  9. On September 23rd, 2010 at 8:40 am How to Stop iPhone from (Incorrectly) Auto-Linking Phone Numbers « Web Page Authority Blog said:

    [...] Adam Darowski | Blog | Stop iPhone from (Incorrectly) Auto-Linking Phone Numbers Tonight, I was building a page and tested it in iPhone. It incorrectly linked some dates. This was problematic because in that specific section, I had all anchors set to display: block;. So, adding these extra links broke the design. [...]

  10. On November 16th, 2010 at 1:08 pm Keep Iphone browser from turning numbers into links Drija said:

    [...] Source: http://www.darowski.com/tracesofinspiration/2009/03/31/stop-iphone-from-incorrectly-auto-linking-pho… [...]

  11. On November 21st, 2010 at 3:02 pm Marcel said:

    Thank you, sir

  12. On March 17th, 2011 at 1:45 pm anthea said:

    Great!! Thanks!

  13. On April 18th, 2011 at 2:18 pm Terri Ann said:

    Any ideas on how to stop the mail app from trying to auto-link addresses and dates too? I’ve tried the obvious, address, location, data, event = no the same way the telephone is structured but haven’t found a solution yet.

  14. On April 24th, 2011 at 3:29 am Robert Jacobs said:

    Didn’t work for me…

    The offending text that launches the phone app (and auto-dials) no matter what is: 9 1 63.95
    It’s not even a phone number. My only fix was to add a $ in front of the 63.95 So now I have 9 1 $63.95

    Ugly, but it works.

  15. On May 22nd, 2011 at 8:19 pm Tim said:

    Does anyone know how I can stop only some sets of numbers from being linked eg dates- but also let the iphone link the real phone numbers?

  16. On July 18th, 2011 at 5:01 pm Gullstandard said:

    Lovely !

    Tim , use 123456788

  17. On July 25th, 2011 at 12:23 pm Ahmed Hisham said:

    Thanks a lot, it was very helpful.