---
title: "WordPress's application/json Alternate Link Is Not a JSON Feed: What rest_output_link_wp_head Adds, and Whether to Remove It"
slug: wordpress-wp-json-alternate-link-not-feed
published: 2026-11-16T13:16:25.142657+00:00
updated: 2026-11-18T08:22:26.798368+00:00
author: "M Asif Rahman"
author_url: https://ar.bd
category: "AI Readiness"
tags: WordPress, REST API, JSON Feed, Link header, rel=alternate, check:E5, check:D3, platform:wordpress
description: "WordPress adds an application/json alternate link to most pages. It is a REST resource, not a JSON Feed. Remove only that line with one filter, then verify."
url: https://aiscan.site/blog/wordpress-wp-json-alternate-link-not-feed
---

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:

```php
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](https://developer.wordpress.org/reference/functions/rest_output_link_wp_head/) prints the same body.

The tag looks like a feed because the [JSON Feed 1.1 spec](https://www.jsonfeed.org/version/1.1/) 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](https://aiscan.site/blog/rss-atom-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:

```text
### 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`:

```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

```php
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](https://thinkrank.ai) 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](https://aiscan.site/blog/link-headers-for-agent-discovery).

## Verify it worked

1. Purge your page cache.
2. Run `npx aiscan-cli yoursite.com` and read the E5 and D3 rows. E5 should name your RSS feed, and D3 should still pass.
3. By hand, on any page or post URL:

```bash
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](https://aiscan.site/blog/add-rss-feed-declare-in-head). If `/feed/` redirects to your homepage instead, a feed-disabling plugin is answering it; [the WordPress section of that guide](https://aiscan.site/blog/add-rss-feed-declare-in-head#wordpress) shows how to bring the feed and its tag back. The [WordPress AI-readiness setup](https://aiscan.site/blog/ai-readiness-setup-wordpress) covers every other check on this platform, and the [Link header corpus](https://aiscan.site/blog/link-header-discovery-corpus) has the full D3 breakdown. Check definitions: [content checks (E5)](https://aiscan.site/docs/checks/content), [discoverability checks (D3)](https://aiscan.site/docs/checks/discoverability), and the [WordPress platform page](https://aiscan.site/docs/platforms/wordpress).

## Your next step

Scan your site at [aiscan.site](https://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](https://aiscan.site/guides).

