WordPress Made Easy

How to Create a Short Links in WordPress

Would you like to create short links to posts or pages on your WordPress blog?

Short links can be included in emails, Facebook messages, and even text messages.

We’ll show you how to use a plugin to generate short links and how to restore the ‘Get Shortlink’ button to the classic WordPress editor in this article.

How to Make a WordPress Short Link

Why Make a WordPress Short Link?

Sharing your website’s content on social media can increase user engagement and bring in new visitors. However, pasting long URLs or links isn’t always the best option.

Because the number of characters you can use on some social media platforms is limited. A shorter URL allows you to include more useful content in your URL, which can increase engagement and traffic to your WordPress site.

That’s why services like Bitly and short URL were created in the first place. They take a long link and cut it down to make it fit into a smaller space.

If you use SEO-friendly URL structures, for example, you might end up with long URLs that look like this:

https://wpexpertpro.com/beginners-guide/self-hosted-wordpress-org-vs-free-wordpress-com-infograph/

That post’s short link saves a lot of space:

http://wpexp.in/b6xh7G

Note: For our short links, we’re using a custom domain, wpexp.in, which is a little more technical to set up and would necessitate the purchase of another domain.

WordPress used to make it simple to get a short link to your blog post or page. In the classic editor, there was a Get Shortlink button right next to the permalink area.

In the Classic Editor, find the Shortlink Button.

However, if you just started your blog, this feature was removed with WordPress version 4.4, so you won’t see it on your WordPress site. The links are still created by WordPress, but the button has been removed.

There are still a few options for getting short links for your WordPress posts and pages.

We’ll go over the best link shortener plugin, as well as a couple of ways to get the classic editor’s ‘Get Shortlink’ button back.

Method 1: Use the Pretty Links Plugin to make short links

We’ll start with a method that everyone can use. The Pretty Links plugin does not use the traditional editor and instead creates its own short link from any URL.

It works with all links, including those to pages on your blog or website that aren’t part of your blog or website. So, in addition to allowing you to share your own content, it’s also ideal for shortening affiliate links.

You’ll need to install and activate the Pretty Links plugin to get started. See our step-by-step guide to installing a WordPress plugin for more information.

Note: Pretty Links has a Pro version with more powerful features like keyword auto-linking and link categories and tags, but we’ll be using the free version for this tutorial.

A Pretty Links section is added to your WordPress dashboard after you activate the plugin. You must go to the Pretty Links » Add Link page to create your first short link.

Then, in the Target URL text field, paste the original URL of the page you want to share. A short Pretty Link is created automatically, but you can change it if you want it to be more readable.

Copy the original URL and paste it into the target URL.

It’s possible that once you’ve made a few short links, you won’t remember what they’re all for. As a result, it’s a good idea to type in the web page’s title and make a list of anything you need to remember.

Complete the Title and Notes sections.

To activate the short link, click the Update button after filling out the Pretty Links form.

To activate the short link, click the Update Button.

A list of all of your Pretty Links will now appear. Simply click the Copy icon on the right of the screen to copy one to the clipboard.

You can then paste it into any of your social media accounts. Pretty Links will even track how many times each link is clicked.

Using the Copy Icon, copy the short link

While pretty links have built-in analytics, you can improve them even more by using the MonsterInsights plugins to connect them to Google Analytics. See our step-by-step guide on how to properly set up Google Analytics in WordPress for more information.

Method 2: Using the Classic Editor’s Bring Back the Shortlink Button Plugin

This is a quick and easy way to restore the Get Shortlink button to the classic editor.

The Bring Back the Shortlink Button plugin must first be installed and activated. See our step-by-step guide to installing a WordPress plugin for more information.

This plugin will automatically add the Get Shortlink button to the classic editor once it is activated. Simply edit any of your posts to see if it worked.

The Classic Editor now has a Get Shortlink button.

The WordPress Shortlink for your post or page will appear when you click the Get Shortlink button. You can copy the link to your clipboard and send it to your recipients in emails and messages.

To share it with your audience, copy the short link.

Method 3: Using Code to Create a Short Link Button in the Classic Editor

This method, which uses code rather than a plugin, is for more advanced users. By adding a custom code snippet to your theme’s functions.php file, it adds the Shortlink button to the classic editor.

We don’t recommend this method to inexperienced users because it could break your website if you make a mistake. Method 2 is a less time-consuming alternative to using code to achieve the same result.

You’ll need to install the Code Snippets plugin first, which is mentioned in that guide. See our step-by-step guide to installing a WordPress plugin for more information.

When you activate the plugin, it will add a new menu item to your WordPress admin bar called Snippets. When you click it, a list of all the custom code snippets you’ve saved on your site will appear.

To create your first custom code snippet in WordPress, click the Add New button.

To add your first custom code snippet in WordPress, click the Add New button.

This will take you to the page where you can ‘Add New Snippet.’

You should begin by giving your custom code snippet a title. Call it the ‘Short Link Button.’ Simply copy and paste the code snippet below into the code box after you’ve entered a title.

1
add_filter( 'get_shortlink', function( $shortlink ) {return $shortlink;} );

Copy the code snippet and paste it into the code box.

You might forget what this snippet is for if you come across it again in the future. As a reminder, it’s a good idea to type something useful in the description.

In the Description field, type something useful.

You can also give your code snippet tags. This will make it easier to organize your code snippets by topic and functionality.

Finally, click the ‘Save Changes and Activate’ button to complete the process. The Shortlink button will be added to the classic editor once the snippet is activated.

The Button for Shortlinks Will Be Added

We hope that this article has shown you how to make a short link in WordPress.

Comments are closed.