WPML’s Sticky Links are links that automatically trace the destination page and can never break.
A Sticky Link automatically (and immediately) changes then the page it’s linking to changes. This doesn’t require any scanning or manual operation – it just happens by itself.
If you’re using the default permlinks, you’re seeing links like:
These links indicate the IDs of pages and posts. They’re never going to change. Once a page, post or category is created it’s assigned a unique identifier (ID). This ID will never change. The title, slug and permlinks can change, but this ID will remain the same.
So, a default link will always work. Even if you later change the permlinks to include the title, publish date and any other scheme, that default link will work.
What happens when you link to a fancy URL?
Most WordPress users prefer to use a fancy URL scheme (like title and publish month) over the default links. This way, the URLs become much more meaningful.
The problem is, fancy URLs can change at any given time. It can happen due to many reasons. You can argue and say that by being careful enough it’s possible to avoid changing pages’ permlinks, but this is like saying you can drive blindfold and avoid accidents. It’s just not possible.
The result is broken internal and external links.
Sticky Links fix the problem by design
This is how WPML creates Sticky Links:
- When saving a post or page, it will scan all internal links and replace them with the ‘default’ links.
- When rendering, it would replace all ‘default’ links with their current permlinks.
The result is that all the links you insert to other pages or posts will be stored as default links to the resource ID. They can never break under any circumstance. No matter how the title, slug or hierarchy changes, or ever if you’ve chosen a completely different permlinks arrangement. All links would always be intact.
When the page is displayed, the links would point to the current URL selected for each page. The default link works too, but requires a browser redirect.
Having to scan every page for links and changing them on-the-fly may seem like a lot of work. In reality it’s not that bad. Calculating the permlinks according to IDs is an extremely fast operation (the other way around is more resource heavy).
And, if you’re using any caching plugin, this operation will only be done once in a long while. Much like the rest of the computing intensive rendering tasks that WordPress needs to do anyway.
Updating existing contents
The Sticky Links administration page offers to scan all posts and pages and fix all existing links. It will check for any internal links and would change them to the default link style.
It also reports broken links and offer to fix them (manually, by the user).