I want a phone number which display on public page will be protected. Example converts phone number characters to HTML entities and bots can't grab the number in plain text. Let me know the trick.
Mobile phone numbers can legally be ported from one provider to another when you switch your mobile phone service, and can also be ported from one mobile phone to another when you upgrade or change devices. But with enough of your personal information, scammers can have your number ported to a device they possess.
You show your email address and/or phone number in your website and sooner or later that information is harvested by spam-bots, so it's important that it's not visible to them, yet, must be visible to your users.
The aim is to make it as easy as possible for customers to contact you – so be there to provide assistance. Overall, it's a great idea for businesses to put their contact number on their website and it can even increase conversions and revenue.
This is a...passing thought, though I'm not sure how practical it would be:
<span class="protectedNumber" title="01234567890"></span>
css:
span.protectedNumber:before {
content: "Phone number: " attr(title);
}
JS Fiddle demo.
Edited, in response to 'cross browser?' question in comments, to add a jQuery option to assist with those browsers that don't have the ability to deal with css-generated content:
$(document).ready(
function(){
$('.protectedNumber').each(
function(){
$(this).text('Phone number: ' + $(this).attr('title'));
});
});
some ideas
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With