Want to turn your WordPress post titles into direct links to external websites? This is perfect for sharing valuable resources without creating full posts. As experienced WordPress developers, we've helped countless sites implement this feature seamlessly. In this guide, we'll walk you through two reliable methods: a beginner-friendly plugin and a custom code solution.

This no-code approach is our top recommendation for non-technical users. It requires just minutes to set up.
Start by installing and activating the Page Links To plugin. See our detailed guide on installing WordPress plugins if needed.
Once activated, edit or create a new post. A new "Page Links To" meta box appears below the editor.

Click "A Custom URL" and enter your external link. Save or publish the post—your title now links to that URL.
This plugin isn't limited to external sites; it also works great for redirecting to other pages or posts on your site.
For full control without plugins, add this code to your theme's functions.php file or a site-specific plugin. We're drawing from years of optimizing WordPress themes for performance and flexibility.
function print_post_title() {
global $post;
$thePostID = $post->ID;
$post_id = get_post($thePostID);
$title = $post_id->post_title;
$perm = get_permalink($post_id);
$post_keys = get_post_custom_keys($thePostID);
$post_val = array();
if (!empty($post_keys)) {
foreach ($post_keys as $pkey) {
if ($pkey == 'external_url') {
$post_val = get_post_custom_values($pkey);
}
}
}
if (empty($post_val)) {
$link = $perm;
} else {
$link = $post_val[0];
}
echo '<a href="' . esc_url($link) . '">' . esc_html($title) . '</a>';
}This function checks for a custom field named external_url. If found, it links the title to that URL; otherwise, it uses the default permalink.
Next, replace your theme's default title output in files like archive.php, content.php, or single.php. Change this:
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>To simply:
<?php print_post_title(); ?>Now, add the custom field: Edit your post and enable Custom Fields via Screen Options (top-right).

In the Custom Fields box, click "Enter New". Set Name to external_url and Value to your URL.

Save the post—your title now links externally. Reuse the field for future links.
This has streamlined content curation for many of our clients. For more tips, check our guide on adding external link icons in WordPress.
Subscribe to our YouTube channel for video tutorials, and follow us on Twitter and Facebook for the latest WordPress insights.