Appearance
Short links in your posts
Turn external links in your posts into short links on save, and convert older posts with one scan. A WP-CLI command puts the original links back.
Link Manager Pro can mask external links in your WordPress posts: when you save a post or page, each full link to another site becomes a short link on your own domain, like yoursite.com/link/aB3dE9xQ. Many people search for this as link cloaking. It's on by default and it changes the saved post. To put the original links back, you run one WP-CLI command.
Before you start
- You need to be an administrator to change the masking settings under Link Manager › Settings › General.
- Scan posts works for anyone who can open Link Manager (Access for editors). Posts their account can't edit are left as they were.
- Masking on save runs for whoever saves the post, including authors who can't open Link Manager.
- Make a backup with Posts and pages ticked before you mask posts you already published. Only an administrator can make one (Back up and restore), so editors ask an administrator first.
How masking links on save works
Mask links when saving posts rewrites the links in a post at the moment it's saved, before WordPress stores it. A new site has it on, so you don't need to do anything to start.
Link Manager › Settings › General- Make sure Mask links when saving posts 1 is on to mask links on every save. Turn it off if you'd rather add short links yourself.
- Optional: enter an Affiliate link prefix 2, like
recommends, to give links to your affiliates a path of their own. Leave it empty to use the Short link prefix (Affiliate link prefix). - Leave Mask internal links 3 off unless links to your own pages should become short links too (see below).
- If you changed anything, select Save changes.

From then on, every save of a published, scheduled or private post or page masks its links, whether you save it in the editor or another plugin saves it through WordPress. A draft is masked when you publish it. Autosaves and revisions are left alone, and so are drafts and pending posts.
Masking reaches posts and pages only. Other content types, like products or portfolio items from another plugin, are never masked, even if they hold links.
Which links masking changes and which it leaves alone
Masking changes only real links, the <a> tags in your post's HTML that readers click, whose address starts with http:// or https:// and points to another site, or to your own site while Mask internal links is on. Everything else in the post stays as you wrote it.
| Link in your post | What masking does |
|---|---|
A full link to another site, like https://example.com/deal | Becomes a short link. If that destination already has a short link, the post reuses it. Otherwise a new one is made, with a random slug of Slug length characters (8 by default). |
| A link that's already one of your short links, under your current Short link prefix, Internal link prefix or Affiliate link prefix | Left as it is. A short link you deleted isn't brought back when you save the post again |
A full link to your own site, like https://yoursite.com/about/ (with or without www.) | Left as it is, unless Mask internal links is on |
A relative link like /about/, an anchor like #prices, or a mailto: or tel: link | Left as it is |
| A link inside a block that keeps its address in the block's settings, like the File block | Left as it is, so the editor doesn't report the block as invalid |
| An address that isn't a link, like an embed or an image | Left as it is |
There's no setting for a list of domains to skip, but a developer can skip single links with the link_manager_pro_mask_url filter (return false: the link stays as written and no short link is made). With masking on, every full link to another site in a post's content becomes a short link, including links to sources you cite. Menus, widgets, comments and excerpts aren't post content, so they're never masked.
What a masked link looks like
Only the link's address changes, and Link Manager Pro adds its rel values to any you wrote. rel is the part of a link's HTML that tells search engines and browsers how to treat it, for example nofollow. Your link text and other attributes stay. On a site with the default settings, this link:
html
<a href="https://www.example.org/plain">our guide</a>is saved as:
html
<a rel="nofollow noopener" href="https://yoursite.com/link/fz8L7u1E">our guide</a>- The
relvalues come from your Redirection settings, which give links to other sitesnofollow noopenerby default. On an affiliate's domain, the affiliate's Link attributes replace them when any box is ticked. When the post reuses an existing short link, that link's own Link attributes are added too. They're written into the post once, so a later change to those settings doesn't update links already masked. - If you set an Affiliate link prefix, a link to an affiliate's domain is saved under it instead, like
yoursite.com/recommends/fz8L7u1E(General settings). - The new short link's destination is the address from your post. On an affiliate's domain it also gets the affiliate's tag and Redirect type. Otherwise it gets your Default redirect type.
- On the page, visitors see the post's ID added to the address, like
yoursite.com/link/fz8L7u1E?pid=140193. The saved post doesn't change. Thepidlets the short link's report credit the click to the post it came from.
Mask internal links
Mask internal links makes full links to your own pages short links too, under the Internal link prefix (go on a new site). It's off by default. On save, it works only while Mask links when saving posts is on. Scan posts uses it either way.
Link Manager Pro never adds nofollow or sponsored to a masked link to your own page, whatever your Redirection settings or an affiliate say, so search engines can still follow it. A rel you wrote yourself stays. The prefix field, and what changing it does, are on General settings. After a prefix change, links that still use the old prefix are recognized as your own short links, so Mask internal links doesn't mask them again (General settings).
If you only want to count clicks between your pages, Track clicks on internal links does that and leaves your links as written (Clicks on links to your own pages).
Turn links in existing posts into short links
Masking on save reaches a post the next time someone saves it. To mask every post you already have in one go, use Scan posts. It follows the same rules as masking on save, and it works whether Mask links when saving posts is on or off.
WARNING
Scan posts edits your posts. Make a backup first: go to Link Manager › Settings › Backup & restore, select Backup, keep Posts and pages ticked, then select Back up now. Before it changes a post, Link Manager Pro saves a revision of it, but only where WordPress keeps revisions.
- Select Scan my site. The Scan posts dialog opens.
- Read Posts and pages to check. It counts your published, scheduled and private posts and pages, like
120 published · 2 scheduled · 5 private, with the total next to it. - Select Scan posts. The dialog shows its progress and how many links became short links so far.
- Keep the tab open until it finishes. To end it early, select Stop: posts already scanned keep their changes, and the rest stay as they were.
- When it's done, read the summary, then select View short links to see the new links, or Done.
The summary can add notes:
- Links left as they were because their block keeps the address in its settings (for example a File block).
- Posts left as they were, because they changed during the scan, your account can't edit them, WordPress would remove some of their content, or saving them would also change their status or URL slug.
- Posts WordPress couldn't save. Run the scan again to retry them.
Setup's Bring your links step offers the same scan as Scan my posts, under Shorten every link already in your posts (Quick start: setup). On a server with WP-CLI, wp link-manager-pro link runs the same scan (WP-CLI commands).
Check that links became short links
Open a masked post on your site and hover over a link you added: the address starts with your domain and prefix, like yoursite.com/link/. The new short links are under Link Manager › Short Links. A short link's report shows Placed in, the number of published posts that link to it, and later Top posts sending clicks (Link report).
How do I undo link masking?
You undo link masking with the WP-CLI command wp link-manager-pro unlink, which puts each masked link back to the address it had when it was masked. There's no button for this in the admin. Turning off Mask links when saving posts only stops future masking: links already masked stay short links in your posts.
Link Manager Pro can do this because it records the original address of every link it masks, with the post. Don't count on revisions for masking on save: the revision made by that save already holds the short link.
WARNING
unlink edits your posts. Back up first, as above, and read the post count in its question before you answer y.
unlink restores links under your Short link prefix, Internal link prefix or Affiliate link prefix, and under a previous prefix (General settings).
- Go to Link Manager › Settings › General, turn off Mask links when saving posts, then select Save changes. While it's on, the next save of a restored post masks it again.
- Run
wp link-manager-pro unlink --dry-runand check the counts. - Run
wp link-manager-pro unlink.
What unlink keeps, and its options, like --ids for single posts and --restore-shortlinks for short links you added yourself, are on WP-CLI commands. Afterwards, the short links stay in your Short Links list, with their clicks. The rel values masking added, like nofollow noopener, stay on the restored links unless you add --strip-rel. That option removes the whole rel, your own values too.
If you plan to delete the plugin, undo all masking first. With the plugin gone, short links in your posts open a 404 page, and deleting its data also removes the record unlink needs (Advanced settings). Plain unlink isn't enough: it keeps short links you added yourself and covers only posts where masking was recorded. Turn off Mask links when saving posts, then run wp link-manager-pro unlink --scope=all --restore-shortlinks --dry-run. If the counts look right, run it again without --dry-run (WP-CLI commands).
Details
| Setting or limit | Default | What it does |
|---|---|---|
| Mask links when saving posts | On (also on new sites) | Masks links each time a post or page is saved. Off stops masking on save; Scan posts and link still mask. |
| Mask internal links | Off | Also masks full links to your own site. On save, works only while Mask links when saving posts is on. |
| Short link prefix · Internal link prefix · Affiliate link prefix | link · go · empty | The path in masked links to other sites, to your own pages and to your affiliates' domains. Every short link opens under any of them. Addresses with an old prefix keep opening their links after a change (General settings). |
| Slug length | 8 | Length of the random slug of each new short link, 6 to 16. |
| Content masked | Posts and pages | Other content types are never masked. |
| Statuses masked | Published, scheduled, private | Drafts and pending posts are left alone, by every way of masking. |
| Scan posts batches | 20 posts per request, at most 20 seconds each | Leaving the page while it runs asks first, then stops after the current posts. |
For developers: the link_manager_pro_disable_auto_mask filter skips masking on a save when it returns true. Scan posts and link ignore it. The link_manager_pro_mask_url filter skips single links and applies to saves, Scan posts and link.
Get more out of it
- Set up your rules before you scan. Choose your
relvalues under Redirection, your affiliates and your Default redirect type first. Masked links keep therelthey got, and each new short link stores its own redirect type. - Try one post first. With masking on, open a post that has a few links to other sites, save it, then view it on your site and check the links. Run Scan posts once that post looks right.
- Keep followed links to the sources you cite. With the default Nofollow setting (All links), every masked link to another site gets
nofollow. Turn Nofollow off to switch it to Selected domains only, then list your partners as bare domains likeshop.example.com. On an affiliate's domain, the affiliate's Link attributes decide instead (Add nofollow or sponsored). - See which posts earn clicks. Each short link in a post carries the post's ID on the page, so the link's report lists the posts that send it clicks under Top posts sending clicks.
- Check your disclosure. With Affiliate disclosure on, a post of the types you chose gets the notice when it links to an affiliate's domain, directly or through a short link, or has a
sponsoredlink. Masking a link to a site you haven't added under Affiliates doesn't add the notice (Affiliate disclosure settings).
If something goes wrong
- If a link in a post didn't become a short link, then check it against the table above. Also check the post: it must be a post or page, and published, scheduled or private.
- If a link you put back by hand turns into a short link again, then Mask links when saving posts is on: every save masks the post again. Turn it off to keep direct links, and turn it on again to undo.
- If Scan posts says posts were left as they were, then run it again for posts that changed during the scan, and ask an administrator about posts your account can't edit.
- If
unlinkleaves short links in your posts, then you added them yourself (add--restore-shortlinks) (WP-CLI commands). - If masked links stopped opening, then most likely a page or redirect now uses an old-prefix address, or the link is scheduled or expired. Update the links, or change the prefix back.
- If a masked link opens a 404 page, then it may have reused a short link that's scheduled or expired. Find that link under Short Links and check its dates.
More fixes are on Troubleshooting.