slop audit
Blog post 74 / Technical SEO

JavaScript SEO testing for client-rendered pages

Test JavaScript SEO before launch. Compare initial HTML with rendered content, diagnose missing links or copy, and verify the public URL in Search Console.

By Slop Audit · 7 min read

JavaScript SEO starts with a direct visit to the public URL. Check what the server delivers, what the browser renders without clicks or an existing session, and what Google can see in Search Console. If a page shows its article only after you navigate from the homepage, a successful click through the app tells you little about how the article works as an entry point.

Run a JavaScript SEO check on one deep URL

Pick a public page that represents a template, such as /docs/rate-limits. Write down a few signals you expect to find on it. For this example, use the heading “API rate limits,” a distinctive sentence about request limits, a link to the retry guide, and the preferred URL. Checking actual copy helps catch a shell that renders a heading alongside an empty body.

  1. Open the deep URL directly in a fresh browser session. Record the status and final address, then check the content before clicking anything.
  2. Save the initial response and compare it with the rendered page. Look for the heading, the sentence, the link destination, and the canonical URL in both.
  3. Open the same route through an internal link. If the results differ from a direct visit, debug the two entry paths separately.
  4. Repeat on one page per public template and on a missing route. Use the soft 404 guide to test whether a missing path returns an error page with a misleading success status.

Google can run JavaScript when processing pages for Search. If the response is an app shell, the main text depends on rendering and on the resources needed to complete it. A successful HTTP response gives you evidence that the server answered. Inspect the result of rendering to find out whether the answer turned into a usable page. Google’s JavaScript SEO basics

Compare initial HTML with the rendered DOM

Fetch the deployed URL with a GET request. Replace the example address with your own. The header file includes each response in the redirect chain, and the HTML file holds the final body.

curl -sS -L --max-redirs 5 --max-time 30 \
  -D route.headers -o route.html \
  -w 'HTTP %{http_code} — %{url_effective}\n' \
  https://example.com/docs/rate-limits

Open route.html as source text. Look inside the body markup. A sentence in a script that serializes route data can show that the server fetched the data while leaving the visible page dependent on JavaScript. Check the head separately for the route title and canonical. If the head changes during rendering, use the title tag and meta description checklist to trace which layer sets each value.

Then open the actual URL in your browser and use the Elements panel to inspect the DOM after the page finishes rendering. Compare these outcomes:

  • The response and DOM both show the expected text. Follow the visible link and verify the destination loads directly. Check that its href contains a usable URL.
  • The response is a shell and the DOM shows the text. The route depends on JavaScript for its content. Check whether the public template should deliver that text on the first response, and inspect Google's live render before drawing conclusions about Search.
  • The response contains the text and the DOM loses it. Look for a client render that replaces the server output with a loading or error state. Compare the deployed script version and the route data with the HTML.
  • Both views lack the text. Inspect routing and data delivery first. Compare a working URL on the same template, then check the failing path and its network requests.

Fix the layer where content disappears

Make direct URLs work without a warm session

If the page loads from the site's menu but stalls on reload, inspect the document, script, and data requests from a clean tab. A router may have preloaded the record during navigation while the direct route depends on a request that returns 401, 404, or a generic HTML response. Fix the public route or its public data endpoint, and keep private records behind access controls.

When the console points to a failed module or rendering exception, record the first error and the resource URL. If a module gets the app shell instead of JavaScript, repair the asset path or hosting rewrite before working on metadata. Use the production JavaScript console error guide to separate the initiating failure from messages it triggers downstream.

Deliver the public content before interaction

For a public docs or marketing template, static generation can include content known at build time. Server rendering can include public content that needs to be fetched per request. In either case, keep the first browser render consistent with the server output. If content disappears when client code starts, check whether the client has the same route data and whether its initial state replaces the markup with a fallback.

Render the core text without a click, scroll, or consent choice. Put discovery links in anchors with an href, even if your router intercepts clicks for faster transitions. A button that fetches a route may be useful for an app action. Use an anchor when visitors and crawlers need a URL they can follow independently. Google’s crawlable link guidance

Add JavaScript SEO testing to CI

If a public template promises to deliver its main text on the first response, test the same URL with JavaScript off and on. The first test exposes a shell or a route that depends on a script to add its links. The second catches content lost after the page becomes interactive. In this sample, wait for the “Copy link” button to become enabled. The example assumes it starts disabled and the application enables it after the client has attached its handler. Use a real readiness signal from your own application.

import { expect, test } from "@playwright/test"

const origin = process.env.RELEASE_ORIGIN ?? "http://localhost:4173"
const url = new URL("/docs/rate-limits", origin).href

for (const javaScriptEnabled of [false, true]) {
  test.describe(`rate limits with JavaScript ${javaScriptEnabled ? "on" : "off"}`, () => {
    test.use({ javaScriptEnabled })

    test("delivers public documentation on a direct visit", async ({ page }) => {
      const response = await page.goto(url)
      expect(response?.status()).toBe(200)
      await expect(page).toHaveURL(url)

      const main = page.getByRole("main")
      if (javaScriptEnabled) {
        await expect(main.getByRole("button", { name: "Copy link" })).toBeEnabled()
      }

      await expect(main.getByRole("heading", {
        level: 1, name: "API rate limits",
      })).toBeVisible()
      await expect(main.getByText("Each API key allows 60 requests per minute."))
        .toBeVisible()
      await expect(main.getByRole("link", { name: "Retry guide" }))
        .toHaveAttribute("href", "/docs/retries")
    })
  })
}

Set RELEASE_ORIGIN to the deployment under test and use copy that will still identify the route after an ordinary edit. Use the no-JavaScript case for templates that promise initial HTML. For deliberately client-rendered public pages, retain the clean browser check and verify how Google renders them. See the Playwright JavaScript option and the website regression testing guide.

Verify the public URL in Search Console

Inspect the canonical production URL in the appropriate Search Console property. Run Test Live URL, open View tested page, and look for the distinctive text and link in the HTML. Use the screenshot for layout context and More info to investigate resource and JavaScript errors. If the browser passes and Google's test lacks the content, check whether needed resources are blocked or whether your CDN serves a different response. Google’s JavaScript troubleshooting guide

Compare the live result with the indexed result separately. The live test describes the tested version of the page. The indexed report gives you information from Google's index, including its canonical choice when available. If the render looks complete but the page is absent from Search, use the indexed report to investigate the stated reason. Search Console URL Inspection documentation

Audit the deployed route with Slop Audit

Once the direct route works, run Slop Audit on that public URL. Review the final HTTP response, initial title and canonical findings, and any first-party runtime errors or failed requests captured during the bounded browser run. Fix the deployment and rescan the same URL to compare findings. Use your route test to confirm that the expected copy and links survived the change, and Search Console to verify Google's view.