Get post links is a WordPress ability from Rank Math SEO — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Get post links
Read-onlyList the internal and external links stored for a specific post, with target post info for internal links.
Requires the Rank Math SEO plugin on WordPress 6.9+ for the Abilities API. AI Visibility abilities require the 'manage_options' capability; Link Genius abilities require 'rank_math_link_builder'; Post SEO abilities require 'rank_math_onpage_general'; Schema abilities require 'rank_math_onpage_snippet'; SEO Analysis abilities require 'rank_math_site_analysis'; Analytics abilities require 'rank_math_analytics'; Content Analysis abilities require 'rank_math_onpage_analysis'. Some outputs (broken-link audit data in get-link-report, extra schema types in get-post-schema) are only populated when Rank Math PRO is active.
What it does
Given a post_id, this ability returns every internal and external link Rank Math's Link Genius has recorded for that post, each with its URL, anchor text, and dofollow status; internal links additionally include the target_post_id. It also returns internal and external counts. Anchor text and dofollow data may be null on the free version of the plugin where that data isn't collected. This gives an AI assistant the concrete link inventory of a post so it can recommend which pages to interlink or which external links to review. Requires the 'rank_math_link_builder' capability.
See it in action
You ask your AI assistant
"Get all the links on post 452 and tell me which internal links point to posts that no longer exist."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| post_id | integer | Yes | ID of the post whose links to retrieve. |
Returns
An object with post_id, an internal array (url, anchor, dofollow, target_post_id), an external array (url, anchor, dofollow), and a counts object with internal/external totals.
Permission
Requires the 'rank_math_link_builder' capability.
More Rank Math SEO abilities
Analyze post content
Gather a post's raw content, metadata, and list of on-page SEO tests so an AI agent can run Rank Math's full on-page analysis itself.
Audit site SEO
Run Rank Math's site-wide SEO audit and get back a structured score with per-test findings and fix hints.
Create AI Visibility brand
Add a new brand to AI Visibility monitoring and automatically kick off its first analysis.
Fix site SEO
Apply an automatic fix for a single failing Rank Math SEO audit test.
Get AI Visibility brand insights
Pull the full AI Visibility analysis for a single brand — score, rank, sentiment, mentions, citations, competitor breakdown, and raw per-query AI responses.
Get AI Visibility brand queries
List the search queries being monitored for a brand's AI Visibility tracking, including which are enabled or auto-generated baselines.