Descrição
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
This plugin only connects your https://bitly.com account to your WordPress site.
Please read privacy and terms of service of Bitly before using this plugin.
Bug reports
Bug reports for Bitly URL Shortener are welcomed in our Bitly URL Shortener repository on GitHub. 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 official homepage
- Read “How to generate Bitly OAuth access token?” from Codehaveli Blog
- Bitly API Documentation
- Follow Codehaveli on Facebook, Instagram & Twitter
- Plugin GitHub Repository
Imagens de tela
Blocos
Este plugin disponibiliza 1 bloco.
- Bitly Share Icons Block for displaying Bitly share icons.
Instalação
- Visit the plugins page within your dashboard and select Add New
- Search for Bitly URL Shortener
- Activate Bitly URL Shortener from your Plugins page
- Go to Tools > Codehaveli Bitly from your WordPress admin menu
- Get your access token from https://bitly.com and save it in the access token field
- Need help? Check our guide: How to generate Bitly OAuth access token?
- 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)
- (Optional) Enter your custom Bitly domain if you’re on a paid plan
- (Optional) Select which post types should automatically generate Bitly links
- (Optional) Enable social share buttons if you want to display share options
- 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 falseIf 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?
-
- In the block editor, search for “Bitly Share Icons” block
- Add the block to your post or page
- Customize which social icons to display (Facebook, LinkedIn, X/Twitter, Telegram, WhatsApp)
- 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 postGET /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 withedit_postscapability
* Include a valid WordPress nonce in the request header (X-WP-Nonce)
Avaliações
Contribuidores e desenvolvedores
“Bitly URL Shortener” é um software com código aberto. As seguintes pessoas contribuíram para este plugin.
ContribuidoresTraduzir “Bitly URL Shortener” para o seu idioma.
Interessado no desenvolvimento?
Navegue pelo código, dê uma olhada no repositório SVN ou assine o registro de desenvolvimento via RSS.
Registro de alterações
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
1.3.1
- PHP Warning: Fixed
1.2.2
- Name changed from
Codehaveli Bitly URL ShortenertoBitly URL Shortenerdue 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





