When your blog post is delivered via feed to a feed reader, relative links have no “relative” from which to determine a starting place. When clicked, they will link to nothing or return a 404 Page Not Found error. This is not a good link to include in a feed.

When I first developed the Tagging Bookmarklet for WordPress and WordPress.com users, I included relative links for the site search tags. At the time, my feeds were set to excerpt or summary, so the bottom of my posts with the site search tags was never in my feeds. I have recently changed to selective full content feeds and now the site search tags appear in the feeds – as relative links. Yikes! Time to change them to absolute direct links!

A common mistake I find in many blog posts is the use of the URL without the http://. This turns a link in a blog post like:

<a href="www.blogherald.com/2007/05/03/if-you-see-this-the-content-is-stolen/" title="If you see this the content is stolen">If You See This The Content is Stolen</a>

to this from my blog:

<a href="https://lorelle.wordpress.com/www.blogherald.com/2007/05/03/if-you-see-this-the-content-is-stolen/" title="If you see this the content is stolen">If You See This The Content is Stolen</a>

Do you think that link will go anywhere? The browser assumes that since the http:// is missing, it’s a relative link. It’s not. It’s a link to nowhere that needs fixing.

Any time you link within your blog post to another post on your blog, you may be tempted to use relative links – but don’t. Use absolute links so the link will work from within your blog’s feeds. And get the http:// part of the address in there so the browser knows the link goes to a web page.

Check Your WordPress Theme Template Files for Relative Links

While you are at it, check throughout your full version WordPress blog and Themes for any relative links that might be slipping into your feed. For example, if you use a WordPress Plugin for generating related posts or other post meta data, are the links full absolute links or relative? They are usually absolute, but look closer.

I’ve done a lot of custom work with my WordPress template files on other blogs which includes using a combination of template tags which generate absolute links and hand coding other links as relative links. Lost in the code confusion, I’ve often overlooked these relative links. When that information goes into a feed, those links lead nowhere.

Define Your Link Destinations

Whether viewing your blog post on your blog or via feed readers, if you link to a non-traditional type of link like a file, email, or ftp site, let your reader’s know before they click.

If you are linking to a file, call it a file and put the size of the file in parentheses:

If you are linking to a PDF file, put (PDF) after the file name. If it’s an FTP site, use (FTP) in the parentheses after the link if the link anchor text isn’t clear. For an email link, make sure it’s clear that it is an email and not a link to a contact form.

There are times when the link you want to link to is only available for a short time, such as a newspaper article which requires registration or membership fees to access after a week or two. Explain this in the text around the link or add an explanation in or after the link in parentheses such as article on DNA research trends (requires registration).

Since your blog readers now have options for how they read their blogs, especially with the improvements in feed readers, help them understand what it is they are going to click on before they click.

20 Comments

I use absolute links but was wondering whether I’d change them all to relative links so I could move my blog. From what you write here, I guess it’s not such a good idea after all. But then how do I move my blog? Find/Replace?

Carthik, if you move your blog with the Theme, and not pay attention to those relative links in the template files, or make a change to your URL, they will get you.

The key issue is those who use them in the posts, but I’ve been caught, as have others, with relatives links in template files being missed. Sure, it may not impact feeds, but it does impact your blog.

What does impact your feed links is errors in linking, such as not using the http:// or WordPress stripping them out because of a malformed link code, or using relative links.

I started using relative links to pages in WordPress because if I use absolute links, it posts the blog entry as a comment to the page. This might be a bug, but a solution someone offered was to use relative links instead. Does anyone know another way to solve this problem?

I just had one of my readers who uses a feed email me this week to inform me that I was using relative links. I hadn’t even considered that a feed reader would leave relative links uncorrected until reading what he had told me!

Alison, what you are talking about is a trackback. It’s automatic. It also helps link one blog post to another. For instance, if I’m writing about a topic that includes an intrasite link to another post I’ve written, when that post is published, it puts a trackback in the blog post (using absolute direct links) and I don’t have to go back to the linked-to post and add a link to the new post for more information or reference. I still can, but trackbacks do the work for me.

If you don’t like it, delete the trackback in your comments panel. But DO NOT turn off comments just to avoid trackbacks. They are working as they should. It’s just a matter of understanding why.

Lorelle,
Yes, it happens automatically. Even if I turn off comments, it still leaves one as a trackback. I went and fixed all the links in my previous posts and then deleted all the trackback comments that got added. I guess this is the only way to keep having absolute links.
Thanks for the advice!

Having relative URLs in your RSS feed is a sign of a problem with the RSS generation. It should automatically prepend your site address including ‘http://’. This is part of the RSS standard, as it is well known that relative URLs are useless in that context. You might want to use: http://feedvalidator.org/ .

Within your site, best practices for links is to always use relative links for your own materials. While most of us never move our sites, it will still prevent the problem that Allison mentions with pingbacks.