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-only
Rank Math SEO SEO rank-math/get-post-links

List 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.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.