# Advanced settings

Choose who can use Link Manager Pro, set report refresh time, trust proxy headers behind a CDN, and decide whether data is deleted on uninstall.
Page: https://docs.linkmanagerpro.com/guides/settings/advanced
Use when someone asks: trust proxy headers wordpress; delete data on uninstall; report cache time
Intent: Info

The Advanced tab decides who can use Link Manager Pro and how often reports refresh. It's also where you tell Link Manager Pro to trust proxy headers from your CDN on your WordPress site, so clicks get the visitor's real IP address and country. And it holds the switch that deletes all plugin data when you delete the plugin.

## Where to find it

Link Manager › Settings › Advanced

In the screenshot, the **Advanced** tab (1) is open. Three rows come first: **Who can use Link Manager Pro** (2), **Refresh reports every** (3) and **Trust proxy headers** (4).

[Screenshot: Advanced settings tab with the Advanced tab, Who can use Link Manager Pro, Refresh reports every and Trust proxy headers marked: 1 to 4 in that order]

Only administrators see Settings. Changes take effect when you select **Save changes** (or press Ctrl+S, ⌘S on a Mac). Until then, each changed row shows **Edited**, and **Cancel** puts back the saved values. If saving fails, **Couldn’t save. Your edits are kept.** appears next to the buttons and **Save changes** becomes **Retry**.

## Settings and defaults

Each row links to its section below. New sites get the same values.

| Setting | Default | Choices | What it does |
|---|---|---|---|
| **Who can use Link Manager Pro** | **Administrators only** | **Administrators only**, **Editors and above** | Who can open the plugin to manage links and see reports. Settings always stay with administrators. [More](#who-can-use-link-manager-pro) |
| **Refresh reports every** | 600 seconds (10 minutes) | 0 to 86400 seconds; 0 turns the saved copy off | How long a short link, redirect or affiliate report is kept before it's built again. A report with no clicks isn't kept. [More](#refresh-reports-every-the-report-cache-time) |
| **Trust proxy headers** | Off | On or off | Reads the visitor's IP address from the forwarded headers and the country from `CF-IPCountry` or `X-Country-Code`, which your CDN or proxy adds. [More](#trust-proxy-headers-and-trusted-proxy-ips-or-cidr-ranges) |
| **Trusted proxy IPs or CIDR ranges** | Empty | One address or range per line | Trusts those headers only on visits from these addresses. Once filled, it applies whatever **Trust proxy headers** says. [More](#trust-proxy-headers-and-trusted-proxy-ips-or-cidr-ranges) |
| **Delete all data when the plugin is deleted** | Off | On or off | With it on, deleting the plugin under **Plugins** removes all its data for good. [More](#delete-all-data-when-you-uninstall-the-plugin) |

## Who can use Link Manager Pro

**Who can use Link Manager Pro** decides whether editors can work in the plugin too. It starts at **Administrators only**. Administrators always have full access, whatever you choose.

Choose **Editors and above** to let users with the Editor role in. They see the **Link Manager** menu and can work in **Dashboard**, **Short Links**, **Campaigns**, **Affiliates** and **Link Intelligence**. That means they can create, change and delete short links, redirects and affiliates, and see every report.

Some things stay with administrators either way:

- **Settings** and all its tabs, including **Migration**, **License**, **Webhooks**, **AI Link Assistant** (with the AI key) and **Backup & restore**. Editors don't see **Settings** in the menu, and opening a settings address takes them to the Dashboard.
- Setup, **System information** in **Help & Support**, and **Adopt address** in the Redirects review panel. Editors see **An administrator can adopt an address.** there instead.

Whatever this setting says, anyone who can edit posts (Contributors and Authors too) can use the editor tools. Those who can publish, such as Authors, can create a short link from the editor, with a destination and an optional slug only. A Contributor can insert existing short links but can't create new ones. They can also use the **AI Link Assistant** and the **Internal link optimization** box on posts they can edit. The full picture is on [Access for editors](https://docs.linkmanagerpro.com/guides/access).

For a technical reader: **Editors and above** means any user who has the `manage_link_manager_pro` capability, usually through their role. Link Manager Pro adds it to the Administrator and Editor roles each time the plugin is activated. It removes it from both when the plugin is deactivated. To let another role or one user in, give them the capability with a role editor plugin. With WP-CLI, `wp cap add author manage_link_manager_pro` gives it to a role, and `wp user add-cap <user> manage_link_manager_pro` to one user.

## Refresh reports every: the report cache time

**Refresh reports every** sets how long Link Manager Pro keeps a saved copy of a report before it builds it again. The default is 600 seconds (10 minutes). Building a report means counting every click behind it, so a saved copy keeps the report quick to open.

It covers the reports of short links, redirects and affiliates. Campaign reports and the Dashboard keep their own copy for 60 seconds and don't follow this setting. The field takes whole numbers.

What it means when you read a report:

- A new click can take up to this long to show under **At a glance**, in **Unique clicks** and in the country, device and source figures. A report with no clicks isn't kept, so the first click shows on the next load. An affiliate's report with no clicks is kept for 1 minute at most.
- **Recent clicks** is read fresh every time, so a click shows there the next time you load the report. The **All-time clicks** column in the Short Links list does too.
- Editing a short link, redirect or affiliate drops every saved copy, so the next report you open is built fresh.

You can enter 0 to 86400 seconds (one day); the arrows move by 60. With 0, reports are built fresh on every view, which costs more database work on a site with many clicks. 0 takes effect straight away. Any other new number applies to copies saved from then on; copies saved earlier keep their old time until it runs out.

## Trust proxy headers and Trusted proxy IPs or CIDR ranges

**Trust proxy headers** makes Link Manager Pro read the visitor's IP address and country from the headers a CDN or proxy adds, instead of from the connection. It's off by default. A CDN is a service such as Cloudflare that sits in front of your site and passes each visit on to it.

Behind a CDN or proxy, every visit reaches your site from the proxy's address. With this off, Link Manager Pro sees that address for every visitor:

- Each click stores the proxy's IP address, and **Unique clicks** can merge visitors.
- **Blocked IP addresses** can't block one visitor.
- Only 30 clicks on one short link from one address are counted per 5 minutes. Behind a proxy, all visitors share that address, so real clicks go uncounted. Visitors are still sent on.
- Five wrong passwords on a [password-protected link](https://docs.linkmanagerpro.com/guides/creating-links#what-visitors-see-on-a-password-protected-link) lock every visitor out of that link, not only the one who typed them.
- The GeoIP database looks up the proxy's address, so the country is the proxy's, not the visitor's. A `CF-IPCountry` or `X-Country-Code` header isn't read.
- [Routing rules](https://docs.linkmanagerpro.com/features/conditional-rules) with a **Country** condition see the proxy's country, or none, so they can send visitors to the wrong destination.

With the switch on, Link Manager Pro checks these headers in order: `CF-Connecting-IP`, `True-Client-IP`, `Fly-Client-IP`, `X-Forwarded-For`, then `X-Real-IP`. The first one that gives a public address wins. With the switch alone, only the last address in `X-Forwarded-For` counts. If no header gives one, it uses the connection's address. For the country, it reads `CF-IPCountry` first, then `X-Country-Code`. A country header under any other name isn't read. If no header gives a country, the GeoIP database looks up the address found this way ([System requirements](https://docs.linkmanagerpro.com/getting-started/requirements#which-php-version-does-the-country-database-need)).

::: warning
Turn on **Trust proxy headers** only if every visit really comes through your proxy or CDN. Otherwise a visitor can send a made-up country or IP address. A faked IP also gets past **Blocked IP addresses**, the count limit of 30 clicks per short link and address in 5 minutes, and the password lockout.
:::

**Trusted proxy IPs or CIDR ranges** is the safer way. Enter the addresses your CDN or proxy connects to your site from, one per line, like `203.0.113.10`. A CIDR range like `203.0.113.0/24` covers a whole block of addresses, and IPv6 ranges work too. Ask your CDN or host for its list.

- Once the list holds anything, Link Manager Pro trusts the headers only on visits that come from an address on it, whatever **Trust proxy headers** says. A visitor who reaches your site directly can't fake an address or a country.
- In `X-Forwarded-For`, it skips the addresses on your list from the right. The first address that isn't on the list counts as the visitor's.
- Saving a line that isn't an IP address or CIDR range is refused with an error under the field that names the bad lines (up to 10), and nothing is saved. A bad line stored earlier is not rewritten, so it still never matches. If every line is wrong, the headers are never trusted, even with the switch on.
- Commas work as separators too.

Select **Save changes** after either change. Only clicks from then on use the new address; stored clicks keep theirs.

## Delete all data when you uninstall the plugin

**Delete all data when the plugin is deleted** decides what happens when you delete Link Manager Pro under **Plugins** in WordPress. It's off by default, so your data stays for a reinstall. Deactivating the plugin never deletes data, whatever this switch says.

::: warning
With this on, deleting the plugin removes all its short links, clicks, redirects, affiliates, reports and settings for good. Make a backup first under Link Manager › Settings › Backup & restore ([Back up and restore](https://docs.linkmanagerpro.com/guides/backup-restore)), and keep the file somewhere other than your site.
:::

1. Go to Link Manager › Settings › Advanced.
2. Turn on **Delete all data when the plugin is deleted**. A dialog asks first, with a **Back up first** link to the backup tab.
3. Select **Turn on**, or **Cancel** to leave it off.
4. Select **Save changes**. The switch takes effect only once it's saved.

What deleting the plugin removes with the switch on:

- The plugin's database tables: short links, clicks, redirects, affiliates, routing rules, Link Health and Link Audit results, webhooks and settings. Safety copies left by a stopped restore go too.
- Every option and temporary value the plugin saved, and its scheduled tasks.
- Your link categories and tags, and the plugin's data on your posts. That data includes the record `wp link-manager-pro unlink` uses to put original links back.
- Link Manager Pro's access permission, from every role.
- The GeoIP database and the backup folders in your uploads folder.

What stays:

- Your posts as they are. Every short link in your posts keeps its address, whether masking made it or you inserted it from the editor. With the plugin gone, those addresses usually open a 404 page. To put the original links back, turn off masking and run `wp link-manager-pro unlink --scope=all --restore-shortlinks` before you delete the plugin ([Uninstall and delete data](https://docs.linkmanagerpro.com/guides/uninstall)).
- Backup files you downloaded to your computer.

On a multisite network, each site follows its own switch. [Uninstall and delete data](https://docs.linkmanagerpro.com/guides/uninstall) walks through the whole removal.

For a technical reader: `wp link-manager-pro uninstall --delete-data` removes the same data straight away, whatever the switch says, and then deactivates the plugin. It asks for confirmation unless you add `--yes`, so the same warning applies. Without `--delete-data`, it does nothing.

## Get more out of it

- Let editors in without giving them your settings. **Editors and above** lets Editors manage links and read reports, while backups, webhooks, imports and the AI key stay with administrators. Authors don't need it to add short links from the editor. Contributors can only insert existing ones.
- Behind a CDN, fill the trusted list instead of only turning on the switch. Clicks then carry the visitor's real address, so **Blocked IP addresses** and [Unique clicks](https://docs.linkmanagerpro.com/features/click-tracking) work as meant. A visitor who skips the CDN can't fake their address.
- Get countries behind Cloudflare without the GeoIP database. Once the headers are trusted, and if Cloudflare sends its `CF-IPCountry` header, each click gets a country on any PHP version. The same country feeds **Country** conditions in [routing rules](https://docs.linkmanagerpro.com/features/conditional-rules).
- Check a test click under **Recent clicks**. It shows straight away, while **At a glance** can wait up to the **Refresh reports every** time (600 seconds by default). On a busy site, a longer time such as 3600 seconds means fewer rebuilds of each report.
- Leave **Delete all data when the plugin is deleted** off until the day you remove the plugin for good. With it off, a reinstall brings back every link and click.

## If something goes wrong

- If an editor can't see the **Link Manager** menu, then check that **Who can use Link Manager Pro** is set to **Editors and above** and saved. Check that the user has the Editor role, too. A role editor plugin may have taken the capability away: give `manage_link_manager_pro` back to the Editor role there, or run `wp cap add editor manage_link_manager_pro`. Deactivating and activating Link Manager Pro also puts it back, but only use that as a last resort. While the plugin is off, no short link or redirect answers, and setup opens again if it was never finished or skipped.
- If an editor asks where **Settings** went, then that's expected. Settings stay with administrators whatever this tab says.
- If every click shows the same IP address or country, then your site is probably behind a proxy or CDN. Fill **Trusted proxy IPs or CIDR ranges** with its addresses, or turn on **Trust proxy headers** if every visit comes through it. Turn it off or empty the list to undo.
- If countries or real addresses stopped after you filled **Trusted proxy IPs or CIDR ranges**, then check each line against the addresses your CDN connects from. Saving a wrong line gives you an error. A bad line stored earlier still never matches.
- If a report shows fewer clicks than **Recent clicks**, then the saved copy hasn't refreshed yet. Wait for the **Refresh reports every** time. To check right away, set it to 0 and save (it takes effect straight away). Then put your value back and save again. After that, an older saved copy can show until it runs out.
- If your links and clicks were still there after you deleted and reinstalled the plugin, then **Delete all data when the plugin is deleted** was off or wasn't saved. Or the plugin folder was deleted outside **Plugins**, for example by FTP, which never runs the clean-up.

More fixes are on [Troubleshooting](https://docs.linkmanagerpro.com/troubleshooting).

## Related

- [Access for editors](https://docs.linkmanagerpro.com/guides/access)
- [All settings](https://docs.linkmanagerpro.com/guides/settings)
- [System requirements](https://docs.linkmanagerpro.com/getting-started/requirements)
- [Uninstall and delete data](https://docs.linkmanagerpro.com/guides/uninstall)
- [Troubleshooting](https://docs.linkmanagerpro.com/troubleshooting)
