# Hooks overview

Link Manager Pro has 7 action hooks and 37 filter hooks that let your code react to link events and change plugin behavior. This page lists them all by area.
Page: https://docs.linkmanagerpro.com/developers/hooks/
Use when someone asks: link manager pro hooks; link manager pro actions and filters; link_manager_pro_ hooks list
Intent: Reference

Use them to run your code on link events or to change how the plugin behaves, without editing the plugin. Every hook links to its full entry on the actions or filters page.

All hooks start with `link_manager_pro_`. Two filters use a slash instead: `link_manager_pro/bot_patterns` and `link_manager_pro/menu_items`.

## Use a hook

An action runs your function at a set moment, such as when a short link is created. A filter passes you a value, and your function returns the value the plugin should use. Add either with `add_action()` or `add_filter()`.

```php
add_action( 'link_manager_pro_link_created', 'myprefix_on_link_created' );
function myprefix_on_link_created( array $payload ): void {
	error_log( 'New short link: ' . $payload['slug'] );
}

add_filter( 'link_manager_pro_picker_per_page', 'myprefix_picker_per_page', 10, 2 );
function myprefix_picker_per_page( int $per_page, string $context ): int {
	return 8;
}
```

- **Where the code goes:** your own plugin or a must-use plugin in `wp-content/mu-plugins`. Do not edit Link Manager Pro files, because an update removes your change.
- **Priority:** the third argument of `add_action()` and `add_filter()`. The default is 10. Lower numbers run first.
- **Accepted arguments:** the fourth argument is how many values your function receives. It defaults to 1, so pass 2 or 3 when the entry lists more parameters.
- **Return the same type:** a filter must return a value of the type it received. Return a string for a string, an array for an array and a bool for a bool.
- **Load early when needed:** `link_manager_pro_booted`, `link_manager_pro_providers`, `link_manager_pro_migration_self_heal` and `link_manager_pro_settings_schema` can run while the plugin loads, before most plugins. Put their code in a must-use plugin.

## Every hook by area

Each hook links to its entry with its parameters, default and an example. Action entries are on [Action hooks](https://docs.linkmanagerpro.com/developers/hooks/actions) and filter entries on [Filter hooks](https://docs.linkmanagerpro.com/developers/hooks/filters).

### Events

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_link_clicked`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-link-clicked) | Action | A visitor click on a short link is counted. |
| [`link_manager_pro_link_created`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-link-created) | Action | A new short link is created. |
| [`link_manager_pro_broken_link_found`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-broken-link-found) | Action | The link checker finds a broken link for the first time. |
| [`link_manager_pro_broken_link_fixed`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-broken-link-fixed) | Action | A broken link is marked fixed or gets a redirect. |

### Lifecycle

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_booted`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-booted) | Action | The plugin has finished loading. |
| [`link_manager_pro_providers`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-providers) | Filter | Add or replace the plugin providers. |
| [`link_manager_pro_migration_self_heal`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-migration-self-heal) | Filter | Turn off the automatic database update. |

### Settings

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_settings_updated`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-settings-updated) | Action | A settings group is saved. |
| [`link_manager_pro_settings_schema`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-settings-schema) | Filter | Add or change settings groups and keys. |

### Caching

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_cache_should_purge`](https://docs.linkmanagerpro.com/developers/hooks/actions#link-manager-pro-cache-should-purge) | Action | Link content changed and page caches should clear. |
| [`link_manager_pro_report_cache_ttl`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-report-cache-ttl) | Filter | Set how long reports stay cached. |

### Redirects and clicks

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_cookie_consent`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-cookie-consent) | Filter | Say whether the tracking cookie is allowed. |
| [`link_manager_pro_skip_filtered_click_count`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-skip-filtered-click-count) | Filter | Leave a click out of the click count. |
| [`link_manager_pro/bot_patterns`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-bot-patterns) | Filter | Change the built-in bot list. |
| [`link_manager_pro_trusted_proxies`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-trusted-proxies) | Filter | Set the trusted proxy addresses. |
| [`link_manager_pro_trust_proxy_headers`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-trust-proxy-headers) | Filter | Trust forwarded headers without a proxy list. |
| [`link_manager_pro_post_credit_hosts`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-post-credit-hosts) | Filter | List sites that can credit a click to a post. |
| [`link_manager_pro_disable_auto_mask`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-disable-auto-mask) | Filter | Skip auto masking on a post save. |
| [`link_manager_pro_mask_url`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-mask-url) | Filter | Leave one link in post content unmasked. |

### Editor link picker

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_picker_enabled`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-enabled) | Filter | Turn the picker on or off. |
| [`link_manager_pro_picker_capability`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-capability) | Filter | Set the capability the picker needs. |
| [`link_manager_pro_picker_create_capability`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-create-capability) | Filter | Set the capability needed to create a short link in the picker. |
| [`link_manager_pro_picker_per_page`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-per-page) | Filter | Set results per search (1 to 20). |
| [`link_manager_pro_picker_excluded_statuses`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-excluded-statuses) | Filter | Hide links by access status. |
| [`link_manager_pro_picker_include_affiliates`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-include-affiliates) | Filter | Show or hide affiliates. |
| [`link_manager_pro_picker_item`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-item) | Filter | Change one result. |
| [`link_manager_pro_picker_toolbar_defaults`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-toolbar-defaults) | Filter | Set the link options ticked by default. |
| [`link_manager_pro_picker_debounce_ms`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-picker-debounce-ms) | Filter | Set the typing delay. |

### Link Equity

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_link_equity_budget`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-link-equity-budget) | Filter | Set the budget per post. |
| [`link_manager_pro_link_equity_position_penalty`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-link-equity-position-penalty) | Filter | Set the penalty for later links. |
| [`link_manager_pro_link_equity_post_budget`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-link-equity-post-budget) | Filter | Set the budget for one post. |

### GeoIP

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_geoip_dir`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-geoip-dir) | Filter | Move the country database folder. |
| [`link_manager_pro_geoip_download_url`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-geoip-download-url) | Filter | Change the database download address. |

### AI

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro_ai_default_models`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-ai-default-models) | Filter | Set each provider default model. |
| [`link_manager_pro_ai_models`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-ai-models) | Filter | Change the model lists. |
| [`link_manager_pro_ai_models_{provider}`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-ai-models-provider) | Filter | Change one provider list. |
| [`link_manager_pro_ai_gemini_thinking_budget`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-ai-gemini-thinking-budget) | Filter | Set the Gemini thinking budget. |
| [`link_manager_pro_ai_rate_max`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-ai-rate-max) | Filter | Set the AI request limit. |
| [`link_manager_pro_ai_rate_window`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-ai-rate-window) | Filter | Set the AI limit window. |

### Admin and logging

| Hook | Type | What it does |
| --- | --- | --- |
| [`link_manager_pro/menu_items`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-menu-items) | Filter | Change the admin submenu. |
| [`link_manager_pro_docs_url`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-docs-url) | Filter | Change the Docs link. |
| [`link_manager_pro_support_url`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-support-url) | Filter | Change the Support link. |
| [`link_manager_pro_social_share_platforms`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-social-share-platforms) | Filter | Change the share buttons. |
| [`link_manager_pro_logger_suppress`](https://docs.linkmanagerpro.com/developers/hooks/filters#link-manager-pro-logger-suppress) | Filter | Silence log lines. |

## Areas without hooks

Disclosure and Migration have no hooks. The plugin does not run its own action or filter in the code for affiliate disclosures or for the imports from other plugins. To change these, use the settings or the [WP-CLI commands](https://docs.linkmanagerpro.com/developers/cli).

## Related

- [Action hooks](https://docs.linkmanagerpro.com/developers/hooks/actions)
- [Filter hooks](https://docs.linkmanagerpro.com/developers/hooks/filters)
- [Events, webhooks and AutomatorWP](https://docs.linkmanagerpro.com/developers/hooks/events)
- [Webhooks and AutomatorWP](https://docs.linkmanagerpro.com/guides/webhooks-automation)
