Bit.ly

Generate shortened URLs for your published posts.

What does this plugin do?

The plugin uses the bit.ly API to generate shortened urls for your posts. It is based on TIME.com’s Bit.ly plugin.

What features does the plugin offer?

  • The plugin automatically assigns bit.ly URLs to all existing posts.
  • The bit.ly URL can be accessed using the wp_get_shortlink(); function.
  • If you’re using a custom short domain with bit.ly, it will automatically be used.

How do I set it up?

After activating the plugin, go to Settings→Bit.ly in your Dashboard’s sidebar menu:

Bit.ly login

Enter your Bit.ly API Login and API Key. If you do not have a Bit.ly account, you can open one at Bit.ly.com.

Shortlinks will not immediately be available for all of your existing posts, but will be generated automatically over time. This may take a while depending on how much content is already in place.

If you want to enable bit.ly link shortening only on certain post types, you can tell the plugin about which types to support:

function my_add_bitly_cpts( $post_types ) {
	$post_types[] = 'my_custom_feature';
	$post_types[] = 'my_other_post_type';
	return $post_types;
}

add_filter( 'bitly_post_types' , 'my_add_bitly_cpts' );

 

What does it look like in action?

When your readers use the Twitter sharing button to share your posts, the Bit.ly shortlink will be used:

Tweet