コード日進月歩

しんくうの技術的な小話、メモ、つれづれ、など

iOSのsafariでは電話番号がハイパーリンクになるので、それを無効化するメタタグがある

独自メタタグシリーズ。

起きる現象

09012345678 のような文字列があると自動的にハイパーリンクになり、押すと電話が起動するというもの。

ただし電話番号とは関係ない文字列の場合もあり、できれば無効化したいことが多い。

書き方

以下のようにメタタグに書く

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

参考元

Supported Meta Tags

Enables or disables automatic detection of possible phone numbers in a webpage in Safari on iOS.

By default, Safari on iOS detects any string formatted like a phone number and makes it a link that calls the number. Specifying telephone=no disables this feature.

機械訳ミックスで和訳すると

デフォルトでiOSSafariは電話番号文字列のフォーマットを検出し、電話として番号を呼び出すリンクにします。 telephone = noを指定すると、この機能は無効になります。

Androidは?

Click to Call | Web Google Developers

telタグ使わない限りは、ならない…みたい

参考リンク