Keep a local business's name, address and phone in sync across your site (and its JSON-LD)
If you build sites for restaurants, dentists, plumbers or any other local business, you have probably shipped the same phone number in four places: the header, the footer, the contact page and a JSON-LD block. Then the client moves to a new suite, someone updates two of the four, and the site quietly disagrees with itself.
That drift is worth preventing for a concrete, documented reason. Google says it collects Business Profile information from several sources, including user reports and licensed content. Ignore a suggested edit for 4 days and Google may make it live on its own, provided other public information, such as the business's own website, backs it up. A stale footer is exactly that kind of public information. The risk isn't a mysterious ranking penalty; it's your client's website vouching for the wrong address.
This post walks through a small pattern: one data file, every template reads from it, and a check fails the build if a hardcoded copy sneaks back in.
Step 1: Put NAP data in one file
Treat name, address and phone like any other config value. Everything below uses placeholder strings on purpose; swap in the real values from the client's Google Business Profile, not from an old brochure.
{ "name": "EXAMPLE_BUSINESS_NAME", "address": { "line1": "EXAMPLE_STREET", "line2": "EXAMPLE_SUITE", "city": "EXAMPLE_CITY", "region": "EXAMPLE_STATE", "postal": "EXAMPLE_ZIP" }, "telephone": "EXAMPLE_PHONE", "url": "EXAMPLE_URL", "showAddress": true } A few field decisions come straight from Google's Business Profile guidelines, and they're worth encoding here so nobody "improves" them later:
-
nameis the real-world name. Google wants the name used consistently on the storefront, website and stationery and known to customers, without extras like taglines. A hypothetical example: if the sign says "EXAMPLE_BUSINESS_NAME", don't let a marketing request turn the config value into "EXAMPLE_BUSINESS_NAME, Best Emergency Plumber in Town". Put the slogan in its own field. -
line2exists for a reason. Google rejects P.O. boxes and remote mailboxes as addresses, while suite and floor numbers belong in Address Line 2. Keeping it as a separate field makes the "we moved suites" update a one-line change. -
telephoneshould be the business's own line. Google asks for a local number instead of a central call center number whenever possible, under the business's direct control, and says not to use numbers that redirect or refer users to landing pages or phone numbers other than the actual business's. Premium numbers aren't accepted. -
showAddressis a policy flag, not a technical one. Google says service-area businesses, like a plumber who drives to customers, should hide their address on the Business Profile. Whether the website shows it is a decision for the owner; the flag just makes that decision explicit in one place.
Step 2: Render every visible copy from the config
Here is a minimal, framework-agnostic helper. Use it in your header, footer and contact page partials instead of typing values into templates.
// nap.js import business from "./business.json" with { type: "json" }; export function formatAddress(a) { return [a.line1, a.line2, `${a.city}, ${a.region} ${a.postal}`] .filter(Boolean) .join(", "); } export function napHtml() { const parts = [`<span class="nap-name">${business.name}</span>`]; if (business.showAddress) { parts.push(`<span class="nap-address">${formatAddress(business.address)}</span>`); } parts.push( `<a class="nap-phone" href="tel:${business.telephone}">${business.telephone}</a>` ); return parts.join("\n"); } Escape values if any of them could ever come from user input. For a static config file, the main win is that there's now one place to edit.
Step 3: Generate the LocalBusiness JSON-LD from the same object
Google's LocalBusiness structured data documentation lists name and address as required and recommends telephone and url. Build the block from the same config so it can't disagree with the visible text:
// jsonld.js import business from "./business.json" with { type: "json" }; export function localBusinessJsonLd(addressObject) { const data = { "@context": "https://schema.org", "@type": "LocalBusiness", name: business.name, address: addressObject, // map business.address to the address format in Google's docs telephone: business.telephone, url: business.url, }; return `<script type="application/ld+json">${JSON.stringify(data)}</script>`; } The address mapping is a parameter on purpose. Check Google's LocalBusiness structured data page for the exact address format and any other properties you need, rather than copying a snippet from a blog post (including this one). Two caveats from that page are worth keeping in mind. Google doesn't guarantee that features using structured data will appear. And markup describes the business; it doesn't fix the client's listings elsewhere. As of November 28, 2026, Google's LocalBusiness structured data page, its representation guidelines and its local ranking tips don't mention citations, directories or consistency across other sites at all.
Also note that an address being required in the markup doesn't settle the service-area question from Step 1. If showAddress is false, talk to the owner before shipping markup that publishes an address the Business Profile hides.
Step 4: Fail the build when a hardcoded copy appears
The pattern only holds if nobody pastes the old number into a blog post or a landing page. A small script over your build output catches that. This version reads a list of retired values (the old phone, the old suite) and flags any page that still contains one:
// check-nap.mjs import { readFileSync, readdirSync, statSync } from "node:fs"; import { join } from "node:path"; const retired = JSON.parse(readFileSync("retired-nap.json", "utf8")); // ["OLD_PHONE", "OLD_SUITE"] const root = process.argv[2] ?? "dist"; let failures = 0; function walk(dir) { for (const entry of readdirSync(dir)) { const path = join(dir, entry); if (statSync(path).isDirectory()) walk(path); else if (path.endsWith(".html")) { const html = readFileSync(path, "utf8"); for (const value of retired) { if (html.includes(value)) { console.error(`${path}: still contains retired value "${value}"`); failures++; } } } } } walk(root); process.exit(failures ? 1 : 0); Wire it into CI after the build step:
npm run build && node check-nap.mjs dist Every time the client changes a detail, move the old value into retired-nap.json. Normalizing phone formats (dashes, spaces, parentheses) before comparing is a sensible extension if content editors type numbers by hand.
One thing to check that code can't
If the site swaps in a call tracking number with a script, Google's guidelines say nothing specific about call tracking or toll-free numbers. Read the tracking setup against the rule about numbers that redirect users elsewhere, and make that call with the client instead of assuming a vendor's summary is right.
And remember the order of operations: the Business Profile is the reference. Your job as the developer is to make sure the website agrees with it, everywhere, from one file.
Originally adapted from: https://sampark.si/insights/does-nap-consistency-still-matter/?utm_source=devto&utm_medium=referral&utm_campaign=offpage-does-nap-consistency-still-matter&utm_content=devto
Disclosure: drafted from a Sampark Insights article and fact-checked against the sources linked above before publishing. The author works at Sampark.