✅ Created comprehensive LocalBusiness schema generator ✅ Added geo-coordinates for 30+ cities ✅ Implemented on Boca Raton page as reference ✅ Build tested and working
For each city page (e.g., PompanoBeachPage.tsx, FortLauderdalePage.tsx, etc.):
- Add imports at the top:
import { generateLocalBusinessSchema, generateBreadcrumbSchema } from '../utils/localBusinessSchema';
import { getCityCoordinates } from '../data/cityCoordinates';- Replace the schema section in the
useEffect:
Find this:
const faqSchema = {
"@context": "https://schema.org",
"@type": "FAQPage",
// ... FAQ content
};
const existingSchema = document.querySelector('script[type="application/ld+json"]');
if (existingSchema) {
existingSchema.remove();
}
const script = document.createElement('script');
script.type = 'application/ld+json';
script.text = JSON.stringify(faqSchema);
document.head.appendChild(script);Replace with:
// Get city coordinates for local search
const coordinates = getCityCoordinates('[CITY NAME]');
// LocalBusiness Schema - Critical for "roofer near me" searches
const localBusinessSchema = generateLocalBusinessSchema({
cityName: '[CITY NAME]',
stateName: 'Florida',
latitude: coordinates?.latitude,
longitude: coordinates?.longitude,
aggregateRating: {
ratingValue: '4.9',
reviewCount: '150'
}
});
// FAQ Schema (keep existing FAQ content)
const faqSchema = {
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
// ... keep existing FAQ questions
]
};
// Breadcrumb Schema
const breadcrumbSchema = generateBreadcrumbSchema([
{ name: 'Home', url: 'https://allphaseconstructionfl.com' },
{ name: 'Service Areas', url: 'https://allphaseconstructionfl.com/service-areas' },
{ name: '[CITY NAME]', url: 'https://allphaseconstructionfl.com/locations/[city-slug]' }
]);
// Remove existing schemas
const existingSchemas = document.querySelectorAll('script[type="application/ld+json"]');
existingSchemas.forEach(schema => schema.remove());
// Add all schemas
const schemas = [localBusinessSchema, faqSchema, breadcrumbSchema];
schemas.forEach(schema => {
const script = document.createElement('script');
script.type = 'application/ld+json';
script.text = JSON.stringify(schema);
document.head.appendChild(script);
});- Update the cleanup function:
Find:
return () => {
const schemaScript = document.querySelector('script[type="application/ld+json"]');
if (schemaScript) {
schemaScript.remove();
}
};Replace with:
return () => {
const schemaScripts = document.querySelectorAll('script[type="application/ld+json"]');
schemaScripts.forEach(script => script.remove());
};Apply in this order (highest traffic cities first):
Broward County:
- Fort Lauderdale
- Pompano Beach
- Coral Springs
- Parkland
- Deerfield Beach
- Coconut Creek
- Hollywood
- Plantation
- Davie
- Sunrise
Palm Beach County:
- Delray Beach
- Boynton Beach
- Wellington
- West Palm Beach
- Palm Beach Gardens
- Jupiter
- Lake Worth Beach
- Royal Palm Beach
If a city is not in cityCoordinates.ts, add it:
'City Name': {
latitude: 'XX.XXXX', // Find on Google Maps
longitude: '-XX.XXXX',
county: 'Broward' // or 'Palm Beach'
}To find coordinates:
- Google "[City Name], Florida"
- Right-click map marker
- Select "What's here?"
- Copy coordinates
See /tmp/cc-agent/61908077/project/src/pages/BocaRatonPage.tsx lines 24-102 for full reference.
After each update:
npm run buildFix any TypeScript errors before moving to next city.
✅ Knows exact service area location (geo-coordinates) ✅ Understands services offered in each city ✅ Sees aggregate ratings (trust signal) ✅ Maps business structure (breadcrumbs) ✅ Recognizes HVHZ certification (authority)
✅ Proximity signals (latitude/longitude) ✅ Service area radius (15 miles from each city) ✅ Local business entity recognition ✅ Enhanced local pack eligibility
- 1 developer = 2-3 hours for all 30+ cities
- Bulk find & replace = 1 hour if cities have similar structure
- Keep existing FAQ content (it's working!)
- Only change schema structure, not page content
- Test build after every 5-10 cities
- Deploy when all cities updated
After deployment, check schema with:
- Google Rich Results Test: https://search.google.com/test/rich-results
- Schema Markup Validator: https://validator.schema.org/
- View page source and search for "application/ld+json"
You should see 3 schema blocks:
- LocalBusiness (RoofingContractor)
- FAQPage
- BreadcrumbList