Table of contents
WordPress prints a <link rel="alternate" type="application/json"> tag on most of its pages, and some feed readers and scanners read it as a JSON Feed. It is not a feed. It is the REST API copy of the one page you are looking at. If you want it gone, one filter line removes that tag and its matching Link header while keeping the REST API and its api.w.org pointer, and you can confirm the change with a scan and two curl commands in under five minutes.
Quick summary
| Your goal | Do this | What changes | Time |
|---|---|---|---|
| Stop the page-level JSON alternate | add_filter( 'rest_queried_resource_route', '__return_empty_string' ); | The alternate tag and header go; rel="https://api.w.org/" stays | 2 minutes |
| Remove every REST discovery line | Two remove_action() calls (below) | Both lines go, in <head> and in the Link header | 2 minutes |
| Turn the REST API off | Not covered by either change | /wp-json/ keeps answering after both | n/a |
| Give agents something real to find | Add a describedby or api-catalog relation first | Discovery stops depending on a WordPress-only pointer | 10 minutes |
Recommended: use the filter, not the two remove_action() lines, and add a real discovery relation before you remove anything else.
Where the tag comes from
Two functions in WordPress core print it. rest_output_link_wp_head() writes the <link> tags into <head>, and rest_output_link_header() sends the same two relations as HTTP Link headers. Both carry @since 4.4.0 in the source fetched from the WordPress 7.1.4 tag on 16 November 2026 (7.1.4 is the current release according to the WordPress.org version API the same day). The per-page alternate line comes from a third function, rest_get_queried_resource_route(), which is @since 5.5.0.
wp-includes/default-filters.php hooks them like this, on lines 336 and 337 of 7.1.4:
add_action( 'wp_head', 'rest_output_link_wp_head', 10, 0 );
add_action( 'template_redirect', 'rest_output_link_header', 11, 0 );
Both functions always print the api.w.org line, which points at your REST root. They add the alternate line only when rest_get_queried_resource_route() returns a route. According to its source, that happens on a singular view (a post or a page, which includes a static front page), on a category, tag or custom taxonomy archive, and on an author archive. A blog index with no static front page gets no alternate. The function reference on developer.wordpress.org prints the same body.
The tag looks like a feed because the JSON Feed 1.1 spec allows it to. Its own words: feeds "should be served using the MIME type application/feed+json", "many feeds will still use the more general MIME type application/json", and a reader "should fall back to accepting application/json". So a reader that finds no application/feed+json link may take the WordPress tag. The document at that URL has id, date, content and _links, and no version or items, the two fields every JSON Feed carries. We verified on 16 November 2026 that betterlinks.io/wp-json/wp/v2/pages/43 returns 23 keys, neither of those two.
What we measured
Our own scan corpus, latest site scan per host, rubric 2026.08.2, aiscan.site excluded, queried on 16 November 2026:
| Check | What the evidence shows | Hosts |
|---|---|---|
| E5 (feeds) | Reported a JSON Feed and passed | 38 |
| E5 (feeds) | ...and the "JSON Feed" URL contains /wp-json/ | 32 |
| D3 (Link header) | WordPress hosts scanned | 211 |
| D3 (Link header) | Passed | 196 |
| D3 (Link header) | Passed, api.w.org visible, no agent relation visible | 127 |
| D3 (Link header) | Passed with an agent relation (describedby, api-catalog and similar) | 9 |
| D3 (Link header) | Failed | 13 |
The E5 row is a bug in our scanner, and we have filed it against ourselves: E5 should match JSON Feed on application/feed+json, or on application/json only when the body carries a JSON Feed version. Until that ships, a WordPress scan can name a /wp-json/ URL as your JSON Feed. Your RSS feed at /feed/ is the real one. The JSON Feed census carries the corrected count.
Then we curled the homepages of three WordPress sites in our own family on 16 November 2026, each with a static front page:
| Site | api.w.org tag | JSON alternate tag | Link header on the response |
|---|---|---|---|
| wpdeveloper.com | yes | /wp-json/wp/v2/pages/1142821 | none |
| betterlinks.io | yes | /wp-json/wp/v2/pages/43 | none |
| essential-addons.com | yes | /wp-json/wp/v2/pages/1334 | none |
All three print both tags. None returned a Link header to us, although core sends one. We did not confirm why; a page cache that replays the HTML without the original headers is one common cause, so check the header on your own site rather than assuming it.
The lab: core's own functions, before and after
We copied the three functions verbatim from the 7.1.4 tag, ran them on PHP 8.3.6 with small stand-ins for the WordPress conditionals, and printed what each view emits. Trimmed output:
### view=page fix=none
header: Link: <https://example.test/wp-json/>; rel="https://api.w.org/"
header: Link: <https://example.test/wp-json/wp/v2/pages/43>; rel="alternate"; title="JSON"; type="application/json"
head: <link rel="https://api.w.org/" href="https://example.test/wp-json/" />
head: <link rel="alternate" title="JSON" type="application/json" href="https://example.test/wp-json/wp/v2/pages/43" />
### view=home fix=none
header: Link: <https://example.test/wp-json/>; rel="https://api.w.org/"
head: <link rel="https://api.w.org/" href="https://example.test/wp-json/" />
### view=page fix=filter
header: Link: <https://example.test/wp-json/>; rel="https://api.w.org/"
head: <link rel="https://api.w.org/" href="https://example.test/wp-json/" />
### view=page fix=remove
(nothing)
Post and category views matched the page view, with /wp/v2/posts/7 and /wp/v2/categories/5.
Fix 1, recommended: drop only the alternate
Add one line to a must-use plugin, for example wp-content/mu-plugins/no-rest-alternate.php (start the file with <?php), or to your child theme's functions.php:
add_filter( 'rest_queried_resource_route', '__return_empty_string' );
rest_queried_resource_route is the filter core runs on the route before printing; an empty string means "no resource", so both functions skip the alternate line. The api.w.org pointer stays, which keeps D3's evidence unchanged on most WordPress sites.
Fix 2: remove both REST discovery lines
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
remove_action( 'template_redirect', 'rest_output_link_header', 11 );
The priorities must match core's, 10 and 11, or remove_action() does nothing. Neither line disables the REST API: /wp-json/ still answers, and the block editor still uses it. The oEmbed tag (application/json+oembed) is printed by a different function and stays.
What it does to D3: on 15 November 2026 we found D3 passing on any <link rel> in the head, including an RSS alternate, so most WordPress sites keep the pass. We filed that as a scanner issue too. Do not count on it.
Which fix? If anything you run (a headless front end, an app, a monitoring tool) discovers your API from the api.w.org relation, use Fix 1. If not and you want a cleaner head, Fix 2 is safe.
Add a real discovery relation first
api.w.org points at the WordPress REST root. It says nothing about your llms.txt, your API catalog or your docs. Before you remove it, point agents at something they can use. According to AIScan's own D3 guidance, fetched from the check's guidance tool on 16 November 2026, a send_headers snippet that adds an api-catalog header is the WordPress route. On WordPress, ThinkRank can publish your llms.txt, which you can then declare with rel="describedby"; ThinkRank does not manage arbitrary response headers, so the header itself stays a snippet. The full pattern is in Link headers for agent discovery.
Verify it worked
- Purge your page cache.
- Run
npx aiscan-cli yoursite.comand read the E5 and D3 rows. E5 should name your RSS feed, and D3 should still pass. - By hand, on any page or post URL:
curl -s https://yoursite.com/about/ | grep -o '<link[^>]*type="application/json"[^>]*>'
curl -sI https://yoursite.com/about/ | grep -i '^link'
curl -s -o /dev/null -w '%{http_code}\n' https://yoursite.com/wp-json/
Expected after Fix 1: the first command prints nothing, the second prints only the api.w.org line (or nothing, if your cache strips headers), and the third prints 200. If the tag is still there, the cache served an old copy or your snippet loaded after wp_head; a must-use plugin loads before themes and plugins.
Who can skip this: if no tool you use misreads the tag, leaving it costs nothing. It is a pointer, not a duplicate page.
Related guides
How to declare the feed you do have is in declare your RSS feed in the head. If /feed/ redirects to your homepage instead, a feed-disabling plugin is answering it; the WordPress section of that guide shows how to bring the feed and its tag back. The WordPress AI-readiness setup covers every other check on this platform, and the Link header corpus has the full D3 breakdown. Check definitions: content checks (E5), discoverability checks (D3), and the WordPress platform page.
Your next step
Scan your site at aiscan.site, check what E5 names as your feed and what D3 credits, then apply Fix 1 and scan again. Fix guides for every other check are at /guides.
Frequently asked questions
My AI-readiness scan names /wp-json/wp/v2/pages/43 as my JSON Feed. Is that right?
No. That URL is the WordPress REST copy of one page, printed by core's rest_output_link_wp_head() with type application/json. A scanner that matches any application/json alternate reads it as a feed. Your real feed on a default WordPress install is RSS at /feed/.
I added the remove_action lines and the JSON link is still in my head. What did I miss?
Usually the priority or the cache. remove_action() only works with the same priority core used: 10 for wp_head and 11 for template_redirect. Then purge your page cache, because a cached copy keeps the old head until it expires.
After removing the REST links, does /wp-json/ stop working?
No. Both fixes only stop WordPress from advertising the REST API in the head and the Link header. /wp-json/ keeps answering, and the block editor keeps using it. Disabling the REST API is a separate change.
My curl shows no Link header at all, even before any change. Is core broken?
Probably not. rest_output_link_header() sends the header on template_redirect, but a page cache that stores only the HTML replays pages without it. On 16 November 2026 three of our own WordPress sites printed both tags and returned no Link header. Test an uncached URL or bypass the cache to see core's output.
Will removing the alternate tag make D3 fail?
Not with the filter fix. rest_queried_resource_route set to an empty string removes only the alternate line and keeps the api.w.org relation. With the two remove_action lines D3 usually still passes on another link tag in the head, but add a describedby or api-catalog relation rather than relying on that.
Which is better: the filter or the two remove_action lines?
The filter, for most sites. It removes the line that gets misread and keeps the REST root pointer that headless front ends and API clients may use. Use the two remove_action lines only if nothing you run discovers the API from api.w.org.
Should I serve a real JSON Feed instead?
Only if a reader asks for it. RSS at /feed/ already covers feed readers and agents. If you add a JSON Feed, serve it as application/feed+json with a version field, as the JSON Feed 1.1 spec asks, so tools can tell it apart from the REST link.
Where do I put the snippet so a theme update does not erase it?
In a must-use plugin, for example wp-content/mu-plugins/no-rest-alternate.php starting with <?php, or in a child theme's functions.php. A must-use plugin loads before themes and ordinary plugins and cannot be deactivated from the dashboard.

About the author
M Asif Rahman
Entrepreneur, curious about AI
I have been building companies for a long time, and lately most of my curiosity goes to AI. AIScan is a small personal project I built on a flight from Dubai to Narita. I use it to understand how ready the web is for AI agents, and I share what the scans teach me.
Related guides
AI readiness setup guide by platform (2026)
Verified 17, 18, 20 and 22 October 2026. Updated on 22 October 2026. An AIready site needs six things: a robots.txt that names AI crawlers D1, B2, a sitemap D2, a declared feed E5, an llms.txt C2,…
Add an RSS Feed AI Agents Can Actually Find
A feed that AI agents can find needs two things: a working RSS, Atom or JSON Feed file, and a <link rel="alternate" tag in your <head that points at it. Most platforms give you only one of the two.…
Link Headers for AI Agent Discovery: Next.js, Astro, Vercel, Netlify, Cloudflare, WordPress
Updated on 15 November 2026: new sections for Next.js, Astro, Vercel, Netlify, Cloudflare and WordPress, each tested in our own lab, plus a corrected description of what check D3 credits, measured on…
