The smart link plugin for WordPress lets you insert links using natural language rather than urls.
<a href="http://example.com"> Example </a>
The resulting increase in usability is quite significant.
A Few Words On Autolink Plugins…
… since this was the initial idea behind smart links.
There are several autolink plugins around. aLinks is one of the better ones, if this is what you'd like to be using. They invariably suffer from one or two niggles:
- They're too systematic: If your keyword shows 10 times in a text, it'll get linked 10 times.
- There are time where it makes more sense to add a keyword link on an entire key phrase, and autolink plugins don't allow this.
Smart links' flexibility lets you work around both niggles.
Using smart links, you insert links using an arrow in between brackets (the same syntax as the one used on several established newspaper websites):
For instance, if you're linking to a page called "dog training tips", you could end up writing:
[teach your puppy to sit->dog training tips]
The syntax is permissive: It's case insensitive and impervious to extra spaces.
If your link text is the same as the link, you can simply close the bracket after the arrow:
[dog training tips->]
For reference, the syntax also works with normal urls and emails:
Also for reference, "slugs" (the sanitized versions of titles that show in the url) work too:
[teach your puppy to sit->dog-training-tips]
These basics in mind, let's hop to how they can become useful for SEO and site maintainability purposes.
How Smart Links Come In Handy
Smart links are useful in that they let you pre-insert links in your site.
The links get silenced when no relevant piece of information is found. They then mutate as the site evolves, in order to point to the most worthy piece of information at all time.
Suppose that you're starting a dog training blog.
During the first week, you add a few posts and add smart links to "dog training tips". You know you'll eventually write about this explicitly, so you might as well add the links as you create the posts.
Shortly after, you spend some time adding a bunch of bookmarks in the link manager. One of them is called "Dog Training Tips". The smart links, which were silenced until now (they were returning the text with no link), now point to the bookmark you've just entered.
You update the bookmark (you change it's url to a better site you've just found) the next day, and the site updates without your even worrying about it.
Eventually, you write a post titled "Dog Training Tips" — and add a smart link to "Dog Training Tips" in it. The old posts are now pointing to this post instead, and the smart link in this post is pointing to your bookmark.
A week later, you write a new post called "Dog Training Tips". The smart links are now all pointing to this new post — because it is more recent than the first one.
At last, you create a section — a static page — called "Dog Training Tips", with a smart link to "Dog Training Tips" in it. All of the smart links are now pointing to this static page. The only exception is the "Dog Training Tips" smart link on that page, which is pointing to your bookmark.
If, upon revisiting your site a year later, you decide to turn the "Dog Training Tips" section into a subsection of "Dog Training", smart links will update themselves and point to the static page's new url.
In other words:
- Smart Links seek to return a link to the bookmark with the same name.
- When posts with the same title exist, Smart Links will point to the most recent post instead.
- When a static page with the same title exists, Smart Links will point to that static page instead.
- On the post or static page that is supposed to get linked to, smart links will try to fallback to a bookmark (there's no point in linking a web page to itself).
- When all else fails, Smart Links return the link text with no link.
Got it all so far? Onto smart link domains.
Smart Link Domains
Domains are areas where smart links scan are for relevant pieces of information. By default, smart links looks all over the place. But you can restrict smart links to certain domains, by using the following syntax:
[link text->link @ domain]
Implicit links work here as well:
[roll over->@ dog tricks]
Built-in domains include those related to WordPress:
- entries (posts and pages)
- wp (all of the above = the default domain)
For instance, you could write:
[teach your puppy to sit->dog training tips @ pages]
The above smart link would get silenced until you create a dog training tips page.
Other built-in domains include:
These create outbound links to the search queries on google, yahoo, msn, and wikipedia respectively.
The last set of built-in domains is dynamic. They let you restrict smart links to a section on your site.
Smart Links understands sections as static pages with no parents. When you use a section domain, only links to static pages within that section will be returned.
On semiologic.com, for instance:
[services->@services]would point to the services section
[services->@members]would point to a services page of the members' area
These dynamic domains become tremendously useful when you start having multiple static pages with the same name on your site. Or when you wish to fine-tune where the smart links are pointing.
Text-Rendering Engine Transparency
The smart link syntax is transparent to Markdown and Textile syntax, but will not allow html code within smart links.
If you want to add a
class="external" attribute to outbond smart links, you need to use the external links plugin.
Smart links use the page title, post title, category name, and link name as relevant.
Smart Link And Comments
Smart links are disabled in comments, to prevent spammers from bypassing anti-spam plugins.
Escaping Smart Links
You can escape the smart link by putting it in between backticks (`), e.g.:
`[escape the link->]`outputs:
[escape the link->]
The backticks will be "used up" when the smart links are processed.
Smart Link Greediness
The smart link syntax is not greedy, e.g.:
[test1 [test2->/] ->/]outputs:
[test1 test2 ->/]
Smart Link Plugins
If you feel like coding, you can register new smart link domains, like this:
The expected signature of domain handling callback functions is the following:
domain_engine($link) returns $links
array($look_for => $found)
$look_foris the reference that is looked for
$foundis of course initialized to
This package is part of Semiologic Pro, and is access-restricted.
Bleeding Edge Zip
Frequently Asked Questions
The Semiologic forum is the best place to report issues.
- Fix missing static designator in PHP code
- WP 3.6 compat
- PHP 5.4 compat
- Fix caching issue with "This Page in Widgets" not refreshing on title or description updates
- WP 3.5 compat
- Updated for Bing
- WP 3.0 compat
- Avoid using broken WP functions
- Cache improvements
- Apply filters to permalinks
- Give more prominence to a page's immediate children
- Fix erratic behavior when scanning for domain-less pages
- WP 2.9 compat
- Complete rewrite
- Code enhancements and optimizations