A URL under /wp-json/ is a data endpoint, not by itself evidence that Google indexed a second article. Compare its JSON response with the public permalink; on a headless site, inspect whether that permalink renders the article before changing crawl rules.
For example, a crawl report may list /wp-json/wp/v2/posts/123 because the crawler discovered the API response. A separate headless site may return only an empty placeholder in the initial HTML of its public article page. Those observations involve the same API but point to different checks: the endpoint is not the reader-facing page, while the page still needs to deliver its content. Inspect each URL and response before blocking /wp-json/ globally.
What the WordPress REST API actually returns
The WordPress REST API organizes resources through routes and endpoints. With pretty permalinks enabled, the API normally lives under /wp-json/; an example post endpoint is /wp-json/wp/v2/posts/123. On sites without pretty permalinks, the same route can use the rest_route query parameter. WordPress documents API responses as JSON and lists resources such as posts, pages, categories and media. The REST API reference lists core routes; its routes guide explains the difference between a route and the endpoints available through it.
A post response can include fields such as title, content, excerpt and public link. That makes the API useful for the block editor, integrations, apps and headless frontends. A permalink, by contrast, can return HTML containing the template, visible navigation, metadata and structured data. A JSON field with the same post title does not prove that both addresses are the same type of page.
There is another distinction to make during a security review: a REST path is not automatically public or private. The core API exposes some data for public reading; private fields and write operations require permissions. Plugins and custom endpoints can register their own rules. The behavior depends on the route, HTTP method and permission check for that endpoint. The REST API Handbook explains which content is public and which requires authentication; custom routes should use a permission callback. Do not rely on the URL name to protect confidential data.
Why an API endpoint can show up in SEO data
A crawler may discover a URL because it is internally linked, listed in a feed or sitemap, requested by JavaScript, or stored in an external system. An SEO crawler may also collect it when it crawls every URL on a domain. That tells you the URL was discovered. It does not tell you whether Google indexed it as an HTML page, whether it appears in search, or whether it serves the same purpose as the post permalink.
Google publishes a list of supported indexable file types. The list includes HTML and several text, XML and document formats, but does not list JSON as an ordinary page type. Do not turn that into a blanket guarantee that no JSON endpoint can ever appear in search systems. The defensible conclusion is narrower: a JSON response is not the same thing as the public HTML page, and you should inspect the exact URL, content type and Search Console evidence rather than infer a second indexed page from a matching article title.
A robots.txt rule does not automatically resolve the issue either. It can limit requests from compliant crawlers, but it is not an authorization or privacy mechanism. If an endpoint exposes private or sensitive data, access control must be correct at the API itself. If an endpoint merely returns public post data, a security problem has not been established by an SEO report.
Four findings that are often conflated
| Observation | What it means initially | Next useful check |
|---|---|---|
/wp-json/wp/v2/posts/123 returns JSON | The API endpoint is reachable and returns data | Check Content-Type, fields, HTTP method and permissions |
| A crawl tool lists the endpoint | The tool discovered or requested the URL | Trace its source and crawl settings |
| Search Console shows the endpoint as a URL | Google recorded or processed a specific URL | Open URL Inspection and indexing details for that endpoint |
| The public permalink is empty or incomplete | The page may not deliver the expected output | Inspect server HTML, rendered page, resources and JavaScript |
These cases call for different actions. An accessible JSON response is not automatically a second HTML copy. An API URL appearing in search data is not automatically a data leak. An API that feeds a broken frontend is not fixed by adding noindex to the endpoint; the public page is the primary failure point.
How to investigate the specific URL
1. Record its response type and HTTP behavior
Fetch the exact URL from the finding with a GET request. Record the status code, redirect chain, final URL, Content-Type and the first useful fields. /wp-json/ may return an API index; /wp-json/wp/v2/posts/123 may return one post. A 200 only tells you that the request received a successful response. It proves neither indexation nor the intended level of public access.
Check whether the report used GET, HEAD or another method. Some endpoints respond differently based on the HTTP method and permissions. Do not attempt write actions with POST, PUT or DELETE just to see if they work. A safe read-only request is enough for an SEO finding.
2. Compare the API response with the public permalink
Compare the API response's link field with the public canonical article URL. Open each address separately:
- The API endpoint should return expected data in its documented JSON format.
- The public permalink should return the correct HTML page with visible main content.
- The HTML page's canonical should point to its preferred public URL.
- Internal links and the sitemap should point to intended public content, not accidentally to API routes.
If the link value in the API record is old or wrong, check WordPress permalink settings, the site URL, a domain migration or a filtering plugin. Do not blindly replace every URL string in a REST response: integrations may intentionally use API links for previews, editing or a separate frontend domain.
3. Read Search Console evidence for the right URL
Open URL Inspection for the specific address and distinguish user-declared signals, Google's last-known version and a live test where the interface provides them. Check robots.txt, noindex, canonical and last crawl. Do not confuse an API endpoint with the public permalink just because the JSON contains the same title.
An SEO crawler and Search Console answer different questions. The crawler shows what its configuration discovered or fetched. Search Console shows Google's data and limitations for a URL. Neither tool alone proves complete processing for every page type. Our guide to canonical and hydration mismatches helps when the public HTML response and rendered DOM differ.
4. Check the full delivery path on a headless WordPress site
In a headless setup, the REST API may supply a Next.js, Astro or other frontend page. Check three separate stages: the WordPress record, the API response and the public frontend URL. The record may be complete while the client requests the wrong fields. The API may return correctly while the frontend waits for a failing script. Or the page may render the content but set conflicting metadata on the server and client.
Test a real public URL as an anonymous visitor. Compare initial HTML with the rendered page. Check title, main text, links, canonical, robots directive and status. If content becomes visible only after JavaScript runs, follow Google's JavaScript SEO guide and confirm that the page renders correctly with its resources loaded. A preview URL is a separate access-control and draft-publication issue; it is not a reason to disable every public API. Our guide to headless CMS previews covers that boundary.
Do not block the REST API on guesswork
A blanket server- or application-level block on /wp-json/, or disabling the API, can break features that depend on it. WordPress says in its REST API FAQ that disabling it breaks dependent admin functionality; the handbook describes the API as the foundation of the block editor and explains its use by apps and frontends. A robots.txt rule is different: it guides compliant crawlers and does not stop a browser from requesting the endpoint. If one public route returns content you do not want, first identify the endpoint and data. Check whether the record should be public, which fields are returned in the view context and whether a plugin registers additional resources.
For a privacy issue, correct the permissions or registration for that endpoint. For an unwanted but harmless API URL in a crawl report, first remove unnecessary public links or sitemap entries, then check whether the URL is still discovered. A noindex directive requires the crawler to fetch the response. A robots.txt rule only guides crawlers: it does not restrict browser or client requests and does not protect JSON from direct access. It can, however, keep Googlebot from fetching API data that a client-rendered page relies on, so verify the public page and its resources separately. Protect sensitive data with real access control.
Test plugin or server-rule changes on a staging environment with real reader paths. Then check the block editor, preview and public page. If a plugin offers a global switch, verify exactly which routes and methods it affects. An SEO goal does not justify accidentally disrupting editorial or business workflows.
Example: a headless migration
A publisher replaces a classic WordPress theme with a headless frontend. The new page at /guides/coffee is served as HTML. A separate request to /wp-json/wp/v2/posts/123 returns the post title and content. A crawler reports both URLs. The team considers blocking /wp-json/ in robots.txt.
The checks show that the JSON route is public and contains the published post. The HTML page returns the same content, a correct canonical and internal links. Search Console provides no evidence that the JSON endpoint is indexed as a search page. The crawl report discovered the route because a rendered script linked to it. The safer action is to understand that link and the crawler's scope. A robots.txt rule would not stop the browser from retrieving the API or protect the JSON, but it could keep Googlebot from fetching API data that client-side rendering relies on. Verify that the public page still renders with crawler-accessible resources before using crawler exclusion. Google's robots.txt guidance distinguishes crawler access from actual access control.
In a second scenario, the public HTML page contains only a loading indicator because a JavaScript bundle fails. The API is healthy, but the page does not reach users and crawlers as intended. The fix belongs in frontend rendering or delivery. The API endpoint remains a useful diagnostic tool, not a substitute for a correct public page.
What the evidence can tell you
A 200 status, a public JSON response or a URL in a crawl report are individual observations. None proves that Google indexed a page or consolidated two pages as duplicates. Conversely, a successful API call does not prove that the public permalink is readable, indexable or current. Check HTTP status codes, indexability, the canonical tag, robots.txt and the actual crawl path for the specific HTML URL.
Record the URL, method, status, content type, timestamp, redirect target and matching public page in the issue. This lets the team distinguish API permissions, crawling, rendering and indexation. A Site Audit should evaluate API routes and public content pages as separate URL types, so a technical finding is not classified as a search-page failure without supporting evidence.