DEV Community

CiteProof
CiteProof

Posted on

A console snippet to audit page structure for AI search (headings, lists, tables, FAQ)

AI search engines like ChatGPT, Perplexity and Google's AI Overviews pull passages from pages, not whole pages. A clear structure makes those passages easy to find: question-style headings, numbered lists for steps, comparison tables, and a short FAQ.

Structure matters more than you might think. In an October 2025 analysis, Ahrefs found that 28.3% of the 1,000 pages ChatGPT cites most had no organic keywords on Google.

Here is a small snippet you can paste in the browser console to get a quick structural audit of any page.

The snippet

// Paste in the browser console on any page.
// Prints a quick structure audit: H1 count, headings, question headings, lists, tables, FAQ hints.
(() => {
  const q = (s) => [...document.querySelectorAll(s)];
  const heads = q('h1, h2, h3').map((h) => ({
    level: h.tagName,
    text: h.innerText.trim().slice(0, 90),
    question: /\?\s*$/.test(h.innerText.trim()),
  }));
  const faqHeading = heads.some((h) => /faq|frequently asked/i.test(h.text));
  const faqSchema = q('script[type="application/ld+json"]').some((s) => /FAQPage/.test(s.textContent));
  const summary = {
    h1: q('h1').length,
    headings: heads.length,
    questionHeadings: heads.filter((h) => h.question).length,
    orderedLists: q('main ol, article ol').length,
    tables: q('main table, article table').length,
    faqHeading,
    faqSchema,
  };
  console.table(heads);
  console.table([summary]);
  return summary;
})();
Enter fullscreen mode Exit fullscreen mode

It scopes lists and tables to main and article so navigation menus don't inflate the count. If your theme uses neither, change the selectors.

How to read the output

  • h1 should be 1. Zero means no main heading; more than one usually means a template issue.
  • Read the headings table top to bottom. It should work as a table of contents of the questions the page answers.
  • questionHeadings: not every heading needs a question mark, but section headings that mirror real customer questions ("How long does it last?") are easier to match.
  • orderedLists: if the page explains a process and this is 0, the steps are probably buried in paragraphs.
  • tables: if the page compares options and this is 0, consider a comparison table: one row per criterion, one column per option.
  • faqHeading / faqSchema: an FAQ with 4 to 8 real questions and short answers helps. FAQPage markup is a bonus; the value is in the answers.

Fixing a page

  1. Turn vague headings ("Overview", "Our approach") into questions or clear topics.
  2. Turn step-by-step paragraphs into a numbered list.
  3. Add a comparison table where people choose between options.
  4. Add an FAQ: 4 to 8 real customer questions, two or three sentences each.

Then re-run the snippet.

The method is lesson 5.2 of our free AEO and GEO course: Structure: headings, lists, tables.

I'm Adrian, founder of CiteProof.

Top comments (0)