Linkify all urls in text with php

It is a good idea to convert all urls into links in your web application like contact form, comment forms, chat application etc. To find and replace all urls with their links we will use php preg_replace function. See below example

$text = "Hello Friends my website url is";
$text = preg_replace("~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~",'<a href="$0">$0</a>',$text);
echo $text;

Hello Friends my website url is

Add extra contact method in wordpress user profiles

WordPress has only two contact fields in users profile that is email and website. That may not be sufficient as there are many social networking sites (like Google+,facebook, twitter etc) are available to connect with users. We can add more contact methods in contact info section. To add more fields edit functions.php file in your WordPress theme folder and add below code.

function new_contactmethods( $contactmethods ) {
    $contactmethods['twitter'] = 'Twitter'; // Add Twitter
    $contactmethods['facebook'] = 'Facebook'; // Add Facebook
    $contactmethods['google'] = 'Google+'; // Add Google+
    return $contactmethods;

Above code will add Twitter, Facebook and Google+ fields in contact info section

Trick to get indexed by Google fast

Are you a webmaster and want to index your website by Google in few hours? Then you are at right place.

Most of the new webmasters have one question: “Why does Google not find my website”. In most of the cases it is due to the fact that your website is not yet indexed by the Google. The Google bot will take some time to find this new website and then only it can index it.  However, you don’t have to wait until Google finds it… You can tell Google about your new website if Google can’t find it. Continue reading