How To Setup Your Own URL Shortener for WordPress

7 Flares Twitter 4 Facebook 2 Google+ 0 LinkedIn 1 Pin It Share 0 StumbleUpon 0 Buffer 0 Buffer 7 Flares ×

Using a third party URL shortener can be dangerous because you lose full control over your links.

This can be a giant mess to cleanup once you’re established as a blogger with thousands of incoming links.

Especially when the links aren’t in your control because you made the mistake of using an external service to shorten and track them.

I’ve already written about this in another post.

So why create links with some else’s brand in the link like Bit.ly or TINY.url?

Solution

One of the best ways to avoid any problems and take full control of your links is to setup your own link shortening service on your own web server.

The easiest way to do this is to install a plugin.

This avoids needing any coding knowledge.

One of the best plugins for this purpose is named YOURLS: WordPress to Twitter

In this tutorial, i’ll be showing you how to setup this plugin using your own urls (YOURLS)

YOURLS-WordPress to Twitter

URL Shortener Service

Once you’ve installed & activated the plugin, you’ll need to go to the settings page.

  1. Select your own YOURLS install
  2. Local, on the same server
  3. Enter the path to Path to YOURLS config.php (might need to ask your host)

URL Shortener Service

 

Setup Twitter Application

You’ll need to follow the links in the plugin settings page and setup an application.

Here’s a screenshot of what i’ve done:

Create an application Twitter Developers

This will give you the keys you need to make the service work.

Here’s what you get:

Application's OAuth Settings

Now you can paste the keys into the plugin settings fields.

Your Access Token

You’ll also need to create an access token.

Access Token

This will give you an access token key and secret.

Access Token and Secret

 

Twitter Settings

Now that you have all the secret keys and tokens, simply paste them into the correct settings fields.

 

Twitter Settings

WordPress Settings

Here you can setup automatic tweeting of new posts.

You can also setup a template which will be included in each message.

I used these settings which means my post title and short url will be tweeted.

Simple copy and paste one of the 3 examples the plugin generates for you into the tweet message field.

 

Template Settings
Tip: According to recent research, adding “Please Retweet” produces 4 times as many retweets.

Support

The best place to get support for this plugin depends on what the problem is.

If you have a great host, they’ll help you.

Otherwise you’ll need to use the official WordPress forum for this specific plugin.

7 Flares Twitter 4 Facebook 2 Google+ 0 LinkedIn 1 Pin It Share 0 StumbleUpon 0 Buffer 0 Buffer 7 Flares ×
Brad Dalton

Brad Dalton

WordPress Consultant 110+ Hrs/Week, traveler and lover of big surf, making new friends & my family. Read more about Brad Dalton or contact me if you need help with WordPress.
Brad Dalton

@wpsitesdotnet

Howdy! WP Sites creates daily tips & tutorials providing solutions for WordPress users.
Add Multiple Sliders In Header On Different Pages http://t.co/TVxsKZ5wLB - 17 hours ago
Brad Dalton

Never Miss The Latest Design Tips!

Comments

  1. I installed the plug-in and am now trying to configure it.

    I reached out to my ISP to request the Path to YOURLS config.php, and they’re telling me: “I can see the files in that folder. There is not a config.php file there.”

    I’m stuck. Can you help?

    • Hello Kim

      That’s right. There’s no config file in the plugins includes directory.

      You could create one and then create the application with Twitter developers to finish the configuration or you could simply use the built in WP.me Shortlinks included in the Jetpack plugin which may be a better and easier solution for you.

      This way the links are also tracked using Jetpack Stats and you already have this plugin installed so you don’t need 2 link shorteners.

      • Kim Whitley-Gaynor says:

        Ah! Alrighty then. I didn’t know that JetPack included that functionality. So much to look at and so much to learn!

        Thanks!

        • Jetpack includes a number of different plugins which you can activate from your Dashboard.

          It also includes subscriptions, social sharing and excellent simple contact forms.

Speak Your Mind

*

Need A Solution for WordPress?

solutions for wordpress
WP Sites offers new posts & 900+ existing tutorials which include:

  1. 1. The basics on using WordPress to build & design a website
  2. 2. Tested PHP & CSS code snippets for easy customization of your theme
  3. 3. Tips, tricks & idea's on how to solve problems with WordPress

 
Enter your email address below & click "Get Updates!"