The Ultimate Guide to Linking WordPress Post Titles to External URLs

Want to link your WordPress post titles to external websites instead of your own post pages? You‘re in the right place!

In this expert guide, I‘ll show you exactly how to direct your post title links to any URL using two methods:

  1. With a simple plugin (no code required)
  2. By adding custom code to your theme files

But first, let‘s look at why you might want to do this and some best practices for using external links effectively.

Why Link Post Titles to External URLs?

According to a recent survey, over 60% of WordPress sites include external links. And of those, many use post titles as the linking anchor text.

Here are a few reasons you might want to send visitors to an external site instead of your WordPress post:

  • Citing a data source or reference
  • Promoting an affiliate product
  • Linking to a guest post or off-site content
  • Sharing a limited-time offer or event page

For example, if you write a post rounding up industry statistics, you could link each statistic‘s heading to the original research study:

[example screenshot]

Or if you‘re promoting a new product launch, you might create a post that links directly to the sales page:

[example screenshot]

External links, when used strategically, can enhance your content‘s credibility and value while also driving targeted referral traffic.

Best Practices for Linking to External Sites

Before we dive into the technical how-to, let‘s cover some important best practices to keep in mind when linking post titles to external URLs:

  1. Relevance is key. Only link to external content that is directly related to your post topic and provides additional value for readers. Irrelevant links will just frustrate users and could hurt your SEO.

  2. Vet your links carefully. Make sure any site you link to is reputable, secure (uses https), and doesn‘t contain spammy or offensive content. You don‘t want to send readers to low-quality or unsafe pages.

  3. Use descriptive anchor text. Since the post title will become the link anchor text, make sure it clearly describes the destination content. Avoid generic phrases like "click here."

  4. Open external links in a new tab. You don‘t want to drive readers completely away from your site. Set external links to open in a new browser tab so they can easily return to your content.

  5. Include an external link indicator. Add a visual cue like an icon to show the link goes to an external site. This improves usability and transparency for readers.

  6. Don‘t overdo it. Aim for no more than 2-3 external links per post. Too many outbound links can dilute the value of your own content and come across as spammy.

With those guidelines in mind, let‘s look at how to actually set up external post title links in WordPress.

Method 1: Using a Plugin to Link Titles to External URLs

The easiest way to link post titles to custom URLs is with the free Page Links To plugin. Here‘s how to set it up:

  1. Install and activate the plugin
  2. Edit the post you want to link
  3. Scroll down to the "Page Links To" box
  4. Enter the full destination URL
  5. Check "Open link in a new tab"
  6. Update the post
[screenshot of Page Links To settings]

That‘s it! The plugin will automatically update the post title link to use the custom URL. This works with both new and existing posts.

Some other handy features of Page Links To:

  • Works with Pages and other post types too
  • Doesn‘t affect your permalink structure
  • Compatible with Classic and Block editors
  • Lets you set links on a per-post basis

One downside is that it only changes the title link on the single post page. If you want the custom link to apply everywhere the title appears (like archives), you‘ll need to use Method 2.

Method 2: Adding Custom Code to Link Titles

For more control over your external title links, you can modify your theme files directly. This requires a bit more technical setup but gives you greater flexibility.

Step 1: Create a custom field for the URL

First, we‘ll register a custom field to store the external URL. Add this code to your theme‘s functions.php file:

function external_url_custom_field() {
  register_post_meta(‘post‘, ‘external_url‘, array(
    ‘show_in_rest‘ => true,
    ‘single‘ => true,
    ‘type‘ => ‘string‘,
  ));
}
add_action(‘init‘, ‘external_url_custom_field‘);

This creates a custom field called external_url that will appear in the post editor.

Step 2: Override the post title link

Next, we need to modify the post title output to use the external URL if it exists. Add this function to functions.php:

function custom_title_link($title, $id) {
  $external_url = get_post_meta($id, ‘external_url‘, true);
  if ($external_url) {
    return sprintf(‘<a href="%s" target="_blank" rel="noopener">%s</a>‘, 
      esc_url($external_url),
      $title
    );
  }
  return $title;
}
add_filter(‘the_title‘, ‘custom_title_link‘, 10, 2);

This hooks into WordPress‘s the_title function. It checks for an external_url value and, if found, wraps the title in a link to that URL. The link also opens in a new tab for better user experience.

Step 3: Add the URL to your post

With the custom field ready, you can add your external URL to the post:

  1. Edit the post
  2. Scroll to the "Custom Fields" box
  3. Enter external_url in the Name field
  4. Paste the full URL in the Value field
  5. Update the post
[screenshot of adding custom field]

Your post title should now link to the external URL everywhere it appears, including archive pages and widgets.

Some benefits of this code method:

  • Keeps your site lean (no extra plugins)
  • Works anywhere the the_title() function is used
  • Allows for more customization (like adding CSS classes)
  • Automatically adds target="_blank" for SEO

The main drawback is that it requires editing your theme files directly. Be sure to use a child theme to avoid losing your changes if the parent theme is updated.

External Link Statistics and Impact on SEO

You might be wondering if linking to external sites can hurt your WordPress SEO. The short answer is: it depends.

Let‘s look at some data:

  • External links to authoritative sites can boost credibility and rankings
  • Too many outbound links, especially to spammy sites, may be seen as suspicious by search engines
  • On average, top-ranking pages have 30% more outbound links than lower-ranking pages (Ahrefs)
  • Relevant external links have been shown to positively correlate with Google rankings (Reboot)

So while you don‘t want to go overboard, strategically linking to valuable external resources can enhance your SEO and user experience.

Just be sure to:

  • Choose high-quality, relevant sites
  • Use descriptive, keyword-rich anchor text
  • Balance external links with plenty of internal links
  • Consider nofollowing affiliate or sponsored links

External Post Title Link Examples and Use Cases

Still not sure how you might use external post title links on your WordPress site? Here are a few real-world examples:

  1. News and entertainment sites often link headlines to original news sources or related coverage on other sites.

  2. Affiliate marketers use post titles to directly promote products and special offers, driving sales and commissions.

  3. Research and data-driven posts can link to studies, surveys, and authoritative sources to back up claims.

  4. Interviews and guest posts may link the title to the contributor‘s site or social profiles.

For instance, a marketing agency could round up industry benchmarks in a series of posts:

[example post screenshot]

Each statistic‘s title links to the original research report or data source, providing additional value and context for readers.

The possibilities are endless! As long as the links are relevant and not overdone, directing titles to external sites can open up new opportunities for your WordPress content.

Frequently Asked Questions

Still have questions about linking post titles to external URLs in WordPress? Here are answers to some common queries:

Can I link to external URLs from page titles too?
Yes! Both methods covered in this guide also work with WordPress pages in addition to posts.

Will this affect my permalink structure?
No, your original post permalink will still work. These methods only change the URL used in the title link itself, not the post‘s actual web address.

What if I want to track link clicks?
You can use a URL shortener like Bitly or a WordPress redirect plugin to create trackable external links. Just enter the shortlink as the custom URL instead of the direct external address.

Do I need to add rel="nofollow" to external links?
It‘s a good practice to add nofollow to external links you can‘t fully vouch for, like affiliate or sponsored content. But relevant editorial links to authoritative sources don‘t require nofollow.

Is it better to use an icon or text to indicate external links?
Both work! An [external link icon] adds a visual cue, while something like "(external link)" in the title itself is more explicit. Choose whichever fits your site design and audience best. You can also use both for maximum clarity.

Conclusion

Well there you have it – a complete guide to linking your WordPress post titles to external URLs. To recap, you can either:

  1. Use the Page Links To plugin for a quick, code-free solution
  2. Add custom code to your theme files for more robust control

Whichever method you choose, linking post titles to external sites can help you:

  • Cite authoritative sources
  • Promote affiliate offers
  • Drive traffic to key pages and profiles
  • Improve the user experience with supplementary info

The key is to use external title links strategically and sparingly. Make sure the links are highly relevant, open in a new tab, and include a visual indicator.

By following the tips in this guide, you can harness the power of external linking to take your WordPress content to the next level!

Have a favorite tool or trick for external links I didn‘t mention? Let me know in the comments!

Did you like this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.