How Does WordPress Redirect Off-Site Links?

How Does WordPress Redirect Off-Site Links?

Subtitle: Pretty Link, a WordPress short-link plugin.

Sometimes we want hyperlinks in a post to appear first as links on our own site: when the mouse hovers over them, the browser’s lower-left corner shows an address under our own domain; after the user clicks, the link redirects to the actual off-site URL. This is often used for referral links, affiliate links, click tracking, or turning very long URLs into shorter links that are easier to remember.

For example, on the http://earnfs.sinaapp.com site, you can turn the external link:

http://www.taskcity.com/?dn=Oldseedling

into this short link on your own site:

http://earnfs.sinaapp.com/taskcity

After visiting it, the user is redirected back to the original external address.

Available Plugins

You can use a short-link or redirect plugin to implement this feature, for example:

  • Pretty Link (recommended)
  • WordPress ShortUrl Plugin

Pretty Link can generate short URLs based on your own domain, similar to short-link services such as tinyurl.com and bit.ly, except the links belong to your own website domain. It can also track clicks on generated links and collect information such as referrers, browsers, and operating systems, making it very suitable for referral and affiliate links.

Pretty Link supports custom URLs, but note that custom short-link paths must not conflict with existing pages, post slugs, or the %postname% structure currently used by the site. Once configured, it can make links shorter and clearer, while also making later tracking and maintenance easier.

Installing and Using the Pretty Link Plugin

  1. Download the Pretty Link plugin, unzip it, and upload the folder to the wp-content/plugins/ directory.
  2. Log in to the WordPress admin dashboard, go to “Plugins,” find the uploaded plugin, and activate it.
  3. After activation, a Pretty Link entry will appear in the admin menu, where you can add and manage short links.

When adding a redirect link, you usually need to fill in:

  • Target URL: the actual off-site link to redirect to.
  • Pretty Link: the short-link path displayed under your own domain, such as /taskcity.
  • Redirect Type: the redirect type. Common choices are 301 or 302. If it is only for a temporary promotion or needs to remain easy to adjust, 302 is safer; if you are sure it will remain fixed long term, you can consider 301.
  • Tracking: whether to track clicks.
  • Nofollow: whether to add the nofollow attribute to the link.

After saving, insert the short link generated by Pretty Link into the post. Readers will see a link on your own site, and after clicking it they will be redirected to the target off-site address.

Main Pretty Link Options

Pretty Link: displays the links currently added, click counts, groups, and other information.

Add New Link: adds a new short link or redirect link.

Groups: creates groups for managing Pretty Links used for different purposes.

Hits: views recent click counts, visitor IPs, redirect targets, and other information for statistical analysis.

Tools: gets the Pretty Link toolbar bookmarklet. While browsing the web, click the bookmarklet to quickly create a Pretty Link.

Options: sets the plugin’s default behavior and tracking options.

Common settings include:

  • Link Option Defaults: sets whether link tracking, nofollow, and related attributes are enabled by default.
  • PrettyBar Options: sets whether the Pretty Bar displays the title, description, sharing links, and URL.
  • Reporting Options: sets reporting options, such as excluding certain IP addresses to avoid counting your own visits.

Pretty Link Pro: sets information related to a Pro account.

This plugin has a fairly complete feature set; the above is only an introduction to its basic usage. In actual use, it is best to create a test link first and confirm that the redirect, tracking, and URL structure all behave as expected before placing it in a published post.

Leave a Reply