WordPress Function to Make your Shortlinks Shorter by Removing WWW

Make your Shortlinks Shorter by Removing WWW

Tested on: WordPress 3.0.1

Make your shortlinks shorter if you include www. in your domain. Via scratch99.com:

add_filter('get_shortlink','sjc_alter_shortlink');
function sjc_alter_shortlink($shortlink) {
    $shortlink = preg_replace('/^(https?:\/\/)?(www\.)/','$1',$shortlink);
    return $shortlink;
}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *