Urgent.News

What's breaking now, across thousands of outlets.

Tech

Adding LocalBusiness Schema to a Next.js App Router Site Without Breaking Anything

If you build websites for plumbers, dentists, law firms or any other local service business, structured data is one of the cheapest technical wins you can ship. A few lines of JSON-LD tell search engines exactly who the business is, where it operates, when it is open and how to reach it. Done well, it supports rich results and helps Google connect the website to the business behind it. Done…

If you operate a business that serves customers in a specific location, adding structured data to your website can improve its visibility in search results. This process is relatively simple and can be accomplished without negatively impacting the existing functionality of a Next.js App Router site.

To begin, create a centralized source file that stores all relevant business information. This file should be typed to ensure consistency and prevent errors. For example, define an interface for opening hours and another for the business object itself. Populate this file with the necessary details such as the business name, URL, logo, phone number, email, price range, service areas, and opening hours.

Next, create a helper function to generate the JSON-LD schema. This function takes the business data as input and constructs the JSON-LD object based on predefined types and properties. By using a specific subtype like 'Plumber' instead of the generic 'LocalBusiness', you provide search engines with more detailed information about the nature of the business.

Include the stable '@id' property to link related schema blocks across different pages. For service areas, only include the relevant city or region rather than a full physical address, if applicable.

Finally, render the JSON-LD schema on the server-side within a small server component in the App Router. This component should output a script tag containing the JSON-LD object, ensuring that search engine crawlers can easily access and understand the structured data. By following these steps, you can effectively implement LocalBusiness schema markup in a Next.js App Router project without disrupting the existing site structure or compromising performance.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Lantern Run: a Halloween roguelike built with Kiro

This post was written as part of the Kiroween 2026 hackathon. Lantern Run is a small browser roguelike. You are a jack-o'-lantern carrying a flame through four rooms.

  • Lantern Run is a Halloween roguelike built with Kiro framework
  • Pumpkin-shaped lantern serves as protagonist in four-room game
  • Property-based testing ensures torch and level mechanics adhere to rules

A four-step asset transfer workflow in Laravel, with a rejection status per step

When a laptop moves from one employee to another, three people want to know: the location manager who owns the stock, the employee who hands it over, and the employee who receives it.

  • Four-step approval process for asset transfer in Osol system
  • Location manager grants permission, current holder confirms handover
  • New holder verifies receipt, oversight department final checks

Codex Never Crashed. It Just Quietly Did Nothing.

Codex Never Crashed. It Just Quietly Did Nothing. From the agentpolicy v0.1.0 release: a local-first, Cedar-based policy decision point for AI agents (decide allow, deny, ask, rate-limit, or redact…

  • Codex failed silently due to API changes
  • Headless test script hung without output
  • 404 errors misinterpreted as server issues

More from Friday 13 November →