Title: Bitly URL Shortener
Author: Codehaveli
Published: <strong>May 26, 2020</strong>
Last modified: January 29, 2026

---

Search plugins

![](https://ps.w.org/codehaveli-bitly-url-shortener/assets/banner-772x250.png?rev
=3449453)

![](https://ps.w.org/codehaveli-bitly-url-shortener/assets/icon-256x256.png?rev=
3449453)

# Bitly URL Shortener

 By [Codehaveli](https://profiles.wordpress.org/codehaveli/)

[Download](https://downloads.wordpress.org/plugin/codehaveli-bitly-url-shortener.1.5.1.zip)

 * [Details](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/#description)
 * [Reviews](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/#reviews)
 *  [Installation](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/#installation)
 * [Development](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/#developers)

 [Support](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/)

## Description

**Bitly URL Shortener** (Previously Codehaveli Bitly URL Shortener) uses the functionality
of Bitly API to generate bitly short link automatically from your WordPress dashboard
when you publish new post.

Bitly URL Shortener allows you to connect your WordPress Website to the Bitly API
via access token and Group GUID.

### Features

 * Generate Bitly link automatically when publishing posts without leaving your 
   site.
 * Share Bitly link from your Post List and Post Edit page with social share buttons.
 * Gutenberg block for displaying social share icons (Facebook, LinkedIn, X/Twitter,
   Telegram, WhatsApp).
 * Support for Custom Post Types with option to choose from your list of post types.
 * Support for Custom Bitly Domain (for paid Bitly plans).
 * Generate Bitly link of your old posts with just one click from post list.
 * WP-CLI support for bulk generating short links via command line.
 * REST API endpoints for programmatic access to short URL generation.
 * Post column in admin showing generated short URLs.
 * Metabox in post edit page for quick access to short URL and share options.
 * Optimized code with modern PHP 7.4+ features and proper error handling.

### Terms of Use

This is not an official plugin of [https://bitly.com](https://bitly.com)

This plugin only connects your [https://bitly.com](https://bitly.com) account to
your WordPress site.

Please read [privacy](https://bitly.com/pages/privacy) and [terms of service](https://bitly.com/pages/terms-of-service)
of [Bitly](https://bitly.com) before using this plugin.

### Bug reports

Bug reports for Bitly URL Shortener are welcomed in our Bitly URL Shortener [repository on GitHub](https://github.com/royrakesh/codehaveli-bitly-url-shortener).
Please note that GitHub is not a support forum, and that issues that are not properly
qualified as bugs will be closed.

### Further Reading

For more info on Bitly and Codehaveli, check out the following:

 * [Codehaveli](https://www.codehaveli.com/) official homepage
 * Read “How to generate Bitly OAuth access token?” from [Codehaveli Blog](https://www.codehaveli.com/how-to-generate-bitly-oauth-access-token/)
 * Bitly [API Documentation](https://bitly.is/2XxT9BN)
 * Follow Codehaveli on [Facebook](https://www.facebook.com/codehaveli), [Instagram](https://www.instagram.com/codehaveli/)&
   [Twitter](https://twitter.com/codehaveli)
 * Plugin [GitHub Repository](https://github.com/royrakesh/codehaveli-bitly-url-shortener)

## Screenshots

[⌊Settings Panel - Configure your Bitly API credentials and options⌉⌊Settings Panel-
Configure your Bitly API credentials and options⌉[

Settings Panel – Configure your Bitly API credentials and options

[⌊Settings access from Tools menu or plugin list⌉⌊Settings access from Tools menu
or plugin list⌉[

Settings access from Tools menu or plugin list

[⌊Generated URL column in post list showing short links⌉⌊Generated URL column in
post list showing short links⌉[

Generated URL column in post list showing short links

[⌊Custom Post type selection checkboxes⌉⌊Custom Post type selection checkboxes⌉[

Custom Post type selection checkboxes

[⌊Social share icons block in Gutenberg editor⌉⌊Social share icons block in Gutenberg
editor⌉[

Social share icons block in Gutenberg editor

## Blocks

This plugin provides 1 block.

 *   Bitly Share Icons Block for displaying Bitly share icons.

## Installation

 1.  Visit the plugins page within your dashboard and select Add New
 2.  Search for **Bitly URL Shortener**
 3.  Activate Bitly URL Shortener from your Plugins page
 4.  Go to **Tools > Codehaveli Bitly** from your WordPress admin menu
 5.  Get your access token from [https://bitly.com](https://bitly.com) and save it 
     in the access token field
 6.   * Need help? Check our guide: [How to generate Bitly OAuth access token?](https://www.codehaveli.com/how-to-generate-bitly-oauth-access-token/)
 7.  Click on **Get GUID** button if you don’t have the Group GUID (the plugin will
     retrieve it from your Bitly account via API call)
 8.  (Optional) Enter your custom Bitly domain if you’re on a paid plan
 9.  (Optional) Select which post types should automatically generate Bitly links
 10. (Optional) Enable social share buttons if you want to display share options
 11. You’re ready to go! From now on, whenever you publish a post, your Bitly link 
     will be generated automatically

## FAQ

### How to get the short link of a post?

Use the `get_wbitly_short_url()` function in your theme or plugin:

    ```
    $link = get_wbitly_short_url($post_id); // Returns short URL or false
    ```

If no post ID is provided, it will use the current post in the loop:

    ```
    $link = get_wbitly_short_url(); // Uses current post
    ```

### How to use the Gutenberg block?

 1. In the block editor, search for “Bitly Share Icons” block
 2. Add the block to your post or page
 3. Customize which social icons to display (Facebook, LinkedIn, X/Twitter, Telegram,
    WhatsApp)
 4. Adjust icon size and styling as needed

### How to generate short links via WP-CLI?

The plugin includes WP-CLI support. Use the following commands:

    ```
    wp wbitly generate --all - Generate shortlinks for all published posts
    wp wbitly generate --ids=1,2,3 - Generate for specific post IDs
    wp wbitly generate --first=10 - Generate for first 10 posts
    wp wbitly generate --all --post_type=page - Generate for all pages
    ```

### How to use the REST API?

The plugin provides REST API endpoints:

 * `POST /wp-json/wbitly/v1/generate/{post_id}` – Generate short URL for a post
 * `GET /wp-json/wbitly/v1/meta/{post_id}` – Get existing short URL for a post

Both endpoints require authentication and appropriate permissions. You need to:
*
Be logged in as a user with `edit_posts` capability * Include a valid WordPress 
nonce in the request header (`X-WP-Nonce`)

## Reviews

![](https://secure.gravatar.com/avatar/467bb8a456a41882ce1c8e5abefb8bd48bcca286526cc1d5d04dd011f0de5c97?
s=60&d=retro&r=g)

### 󠀁[Works Well!](https://wordpress.org/support/topic/works-well-2575/)󠁿

 [Adam](https://profiles.wordpress.org/panhead/) July 4, 2022

Easy to use URL shortener that works with Bitly! Highly recommended.

![](https://secure.gravatar.com/avatar/69d308ba057c7b7f844747fe7f2494c464e47a020434faeb5c8bd640cae739f2?
s=60&d=retro&r=g)

### 󠀁[Great Plugin and very simple to use](https://wordpress.org/support/topic/great-plugin-and-very-simple-to-use/)󠁿

 [crich80](https://profiles.wordpress.org/crich80/) January 27, 2021

I was looking for a simple plugin to shortify quickly the links of my articles. 
This plugin does exactly what I needed and in a very simple way! Thanks to the autor.

![](https://secure.gravatar.com/avatar/80d3c2eda65e8269836e1ba210ed18518caf5d698222336f8574bddf186ba0aa?
s=60&d=retro&r=g)

### 󠀁[Very Important plugin](https://wordpress.org/support/topic/very-important-plugin-8/)󠁿

 [4rez](https://profiles.wordpress.org/4rez/) December 20, 2020 1 reply

I installed this plugin in every blog, without this plugin I don’t know how can 
I save my time. Thanks, developer.

![](https://secure.gravatar.com/avatar/5eb21c7c17b4ff0a9ed3dc526300c8e3f66d109ac0358668178ab2fe46ee0fe4?
s=60&d=retro&r=g)

### 󠀁[Great plugin, and great communication with the developer](https://wordpress.org/support/topic/great-plugin-and-great-communication-with-the-developer/)󠁿

 [ballwebhost](https://profiles.wordpress.org/ballwebhost/) September 27, 2020

The Plugin is extremely useful for us as a media company, and works as expected 
and needed. Initially, the functionality for custom post types wasn’t there so I
reached out to the developer to see if they had any plans to introduce this in the
future. To my surprise, I received an email from the developer today saying they
were looking into it – and a short while later, there was an update available with
the functionality added! Great service! 100% recommend for your shortlink needs!

![](https://secure.gravatar.com/avatar/d24923a0cea6ae8762747a4942827b3b591a6ce7a93c86f28abf3e2c80c90839?
s=60&d=retro&r=g)

### 󠀁[Great plugin](https://wordpress.org/support/topic/great-plugin-27248/)󠁿

 [pipin77](https://profiles.wordpress.org/pipin77/) July 31, 2020

We use this plugin in combination with WP to Twitter and it works great. And good
support if you have a problem.

 [ Read all 5 reviews ](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/)

## Contributors & Developers

“Bitly URL Shortener” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Codehaveli ](https://profiles.wordpress.org/codehaveli/)
 *   [ Rakesh Roy ](https://profiles.wordpress.org/royrakesh/)

[Translate “Bitly URL Shortener” into your language.](https://translate.wordpress.org/projects/wp-plugins/codehaveli-bitly-url-shortener)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/codehaveli-bitly-url-shortener/),
check out the [SVN repository](https://plugins.svn.wordpress.org/codehaveli-bitly-url-shortener/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/codehaveli-bitly-url-shortener/)
by [RSS](https://plugins.trac.wordpress.org/log/codehaveli-bitly-url-shortener/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.5.1

 * MetaBox issue fixed

#### 1.5.0

 * Added Gutenberg block for social share icons
 * Added WP-CLI support for bulk generating short links
 * Added REST API endpoints for programmatic access
 * Improved code structure with modern PHP 7.4+ features
 * Enhanced error handling and logging
 * Updated minimum requirements: PHP 7.4, WordPress 5.6
 * Improved security with better input validation
 * Code refactoring and optimization

#### 1.4.1

 * Updated: tested up to value
 * Security Fix
 * Updated Twitter logo to X
 * Refactor ajax code

#### 1.3.3

 * Updated: tested up to value

#### 1.3.2

 * Updated: tested up to value
 * Add support for [ Yoast Duplicate Post ](https://wordpress.org/plugins/duplicate-post/)

#### 1.3.1

 * PHP Warning: Fixed

#### 1.2.2

 * Name changed from `Codehaveli Bitly URL Shortener` to `Bitly URL Shortener` due
   to SEO conflict with codehaveli.com

#### 1.2.1

 * Support WordPress Core Shortlinks Filters.
 * Shortener link from Front end.
 * Code optimized.

#### 1.1.4

 * Meta Box added in Post Edit Page, now you can share link from your post page
 * Some security issue fixed.

#### 1.1.3

 * Custom Post Type Selection Added and default set to ‘post’.
 * Small bug fixed

#### 1.1.2

 * Custom Post Type Support Added

#### 1.1.1

 * Versioning fixed.
 * Code optimized.

#### 1.1

 * Option added to share link from post list
 * Generate old posts link from post list
 * Function refactored
 * Error handler added
 * Some bug fixed

#### 1.0

 * Initial Release

## Meta

 *  Version **1.5.1**
 *  Last updated **6 months ago**
 *  Active installations **500+**
 *  WordPress version ** 5.6 or higher **
 *  Tested up to **6.9.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [bitly](https://wordpress.org/plugins/tags/bitly/)[connector](https://wordpress.org/plugins/tags/connector/)
   [post](https://wordpress.org/plugins/tags/post/)[short url](https://wordpress.org/plugins/tags/short-url/)
   [url shortener](https://wordpress.org/plugins/tags/url-shortener/)
 *  [Advanced View](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  5 5-star reviews     ](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/reviews/)

## Contributors

 *   [ Codehaveli ](https://profiles.wordpress.org/codehaveli/)
 *   [ Rakesh Roy ](https://profiles.wordpress.org/royrakesh/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/codehaveli-bitly-url-shortener/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/paypalme/royrakesh92)