Why Server-Side Meta Tags Matter for AEO
AI engines and search crawlers request your page as a server renders it. They do not execute JavaScript. This means meta tags added by client-side JavaScript -- even if they appear correctly in a browser -- are invisible to AI crawlers. AEO meta tags must be injected on the server before the HTML response is sent.
For a Replit Express app, this means the Express server adds the correct meta tags to the HTML before sending it to the client -- not after it arrives in the browser.
The critical difference: a React app that adds meta tags in a useEffect or a client-side script is invisible to AI engines for AEO purposes. An Express app that injects meta tags in a server-side function before sending HTML is fully crawlable.
The Implementation
Ask Claude: "Add server-side AEO meta tag injection to my Express app. Create a function called injectPageMeta(html, meta) that takes an HTML string and a meta object with title, description, url, and ogImage properties. It should inject title tag, description meta, og:title, og:description, og:url, og:type, and canonical link tags into the HTML head section. Use this function in every route before sending the HTML response."
Route-Specific Meta Tags
Each page on your site should have unique title and description tags optimized for the specific question that page answers. A blog post about vibe coding should have a title that includes the specific question being answered and a description that contains the direct answer in the first seventy-five words. Ask Claude to create a metadata configuration object for each route and pass it to the injection function.