Family Encyclopedia >> Electronics

How to add a shortlinks menu item in WordPress admin bar

In WordPress 3.3, in an effort to minimize clutter, the WordPress UI team revamped the admin bar. In the process, they removed a very useful feature from the admin bar's "Shortlink" menu. We're sure the reasoning was probably that there aren't enough people using that feature. However, of all the power users we've talked to, all said they found this feature very useful. For WPBeginner, we have a branded shortlink (wpbeg.in), so we needed this feature badly. We asked WP-Bit.ly plugin developers to add this feature in their plugin because we use them to automatically generate branded short url. When no action was taken, we entered the kernel and it was quite easy to add the menu item back. So we add a line of code, and there we have it. In this article, we will show you how you can add the shortlinks menu to your WordPress 3.3 admin bar.

All you have to do is add the following line of code to your functions.php file or site-specific plugin file:

add_action ('admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90);

That's all you have to do.

For those users who want this feature without breaking the code, we did a quick search and found the Renee Shortlink Item plugin in the admin bar. The code for this plugin is just that one line, so it's very minimal. Activate it and forget it..