← All Tools
SCHEMA MARKUP GENERATOR

Law Firm Schema Markup Suite

Generate production-ready JSON-LD schema markup for law firm websites. Improve local SEO, visibility, and click-through rates.

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Need Expert Implementation?

Our schema implementation specialists will ensure your law firm website is perfectly optimized for search engines and rich results.

`; navigator.clipboard.writeText(script).then(() => { showToast('Copied with script tags!'); }); } function copyRaw(elementId) { const jsonText = document.getElementById(elementId).innerText; navigator.clipboard.writeText(jsonText).then(() => { showToast('JSON copied to clipboard!'); }); } function showToast(message) { const toast = document.createElement('div'); toast.className = 'toast'; toast.textContent = message; document.body.appendChild(toast); setTimeout(() => toast.remove(), 3000); } // LAW FIRM LOCALBUSINESS function generateLocalBusiness() { const firmName = document.getElementById('firmName').value; const firmWebsite = document.getElementById('firmWebsite').value; const firmPhone = document.getElementById('firmPhone').value; const firmStreet = document.getElementById('firmStreet').value; const firmCity = document.getElementById('firmCity').value; const firmState = document.getElementById('firmState').value; const firmZip = document.getElementById('firmZip').value; const firmLogo = document.getElementById('firmLogo').value; const firmImage = document.getElementById('firmImage').value; const priceRange = document.getElementById('priceRange').value; const fields = [ { id: 'firmName', label: 'Firm Name', required: true }, { id: 'firmWebsite', label: 'Website URL', required: true }, { id: 'firmPhone', label: 'Phone Number', required: true }, { id: 'firmStreet', label: 'Street Address', required: true }, { id: 'firmCity', label: 'City', required: true }, { id: 'firmState', label: 'State', required: true }, { id: 'firmZip', label: 'Zip Code', required: true } ]; const isValid = showValidation('localBusinessOutput', fields, 'lbValidation'); // Get practice areas const practiceAreas = []; document.querySelectorAll('#localBusiness .checkbox-wrapper input[type="checkbox"]:checked').forEach(cb => { practiceAreas.push(cb.value); }); // Build hours specification const openingHours = buildOpeningHours(); const schema = { "@context": "https://schema.org", "@graph": [ { "@type": "LocalBusiness", "@id": firmWebsite, "name": firmName, "url": firmWebsite, "telephone": firmPhone, "address": { "@type": "PostalAddress", "streetAddress": firmStreet, "addressLocality": firmCity, "addressRegion": firmState, "postalCode": firmZip, "addressCountry": "US" }, "openingHoursSpecification": openingHours, ...(firmLogo && { "logo": firmLogo }), ...(firmImage && { "image": firmImage }), ...(priceRange && { "priceRange": priceRange }), "sameAs": [] }, { "@type": "LegalService", "@id": firmWebsite + "#service", "provider": { "@id": firmWebsite }, "name": firmName + " Legal Services", "areaServed": { "@type": "State", "name": firmState }, ...(practiceAreas.length > 0 && { "serviceType": practiceAreas }) } ] }; document.getElementById('localBusinessJson').innerHTML = highlightJSON(schema); document.getElementById('localBusinessOutput').style.display = 'block'; } function buildOpeningHours() { const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; const dayIds = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']; const hours = []; dayIds.forEach((dayId, index) => { const closed = document.getElementById(dayId + 'Closed').checked; if (!closed) { const open = document.getElementById(dayId + 'Open').value; const close = document.getElementById(dayId + 'Close').value; if (open && close) { hours.push({ "@type": "OpeningHoursSpecification", "dayOfWeek": days[index], "opens": open, "closes": close }); } } }); return hours; } function clearLocalBusiness() { document.querySelectorAll('#localBusiness input, #localBusiness select, #localBusiness textarea').forEach(el => { if (el.type === 'checkbox') el.checked = false; else if (el.type === 'time') el.value = ''; else el.value = ''; }); document.getElementById('localBusinessOutput').style.display = 'none'; // Reset defaults document.getElementById('firmZip').value = ''; } function updateDay(dayId) { // Placeholder for day updates } // ATTORNEY PERSON function generateAttorney() { const attorneyName = document.getElementById('attorneyName').value; const attorneyTitle = document.getElementById('attorneyTitle').value; const attorneyFirmName = document.getElementById('attorneyFirmName').value; const attorneyFirmURL = document.getElementById('attorneyFirmURL').value; const attorneyBioURL = document.getElementById('attorneyBioURL').value; const attorneyPhoto = document.getElementById('attorneyPhoto').value; const attorneyBar = document.getElementById('attorneyBar').value; const attorneyStates = document.getElementById('attorneyStates').value; const attorneySchool = document.getElementById('attorneySchool').value; const attorneyEmail = document.getElementById('attorneyEmail').value; const attorneyPhone = document.getElementById('attorneyPhone').value; const attorneyLinkedIn = document.getElementById('attorneyLinkedIn').value; const attorneyAvvo = document.getElementById('attorneyAvvo').value; const attorneyPracticeAreas = document.getElementById('attorneyPracticeAreas').value; const attorneyAwards = document.getElementById('attorneyAwards').value; const fields = [ { id: 'attorneyName', label: 'Full Name', required: true }, { id: 'attorneyTitle', label: 'Job Title', required: true }, { id: 'attorneyFirmName', label: 'Firm Name', required: true }, { id: 'attorneyFirmURL', label: 'Firm URL', required: true } ]; const isValid = showValidation('attorneyOutput', fields, 'attValidation'); const schema = { "@context": "https://schema.org", "@graph": [ { "@type": "Person", "name": attorneyName, "jobTitle": attorneyTitle, "worksFor": { "@type": "LocalBusiness", "name": attorneyFirmName, "url": attorneyFirmURL }, ...(attorneyPhoto && { "image": attorneyPhoto }), ...(attorneyBioURL && { "url": attorneyBioURL }), ...(attorneyEmail && { "email": attorneyEmail }), ...(attorneyPhone && { "telephone": attorneyPhone }), "sameAs": [ ...(attorneyLinkedIn ? [attorneyLinkedIn] : []), ...(attorneyAvvo ? [attorneyAvvo] : []) ], ...(attorneyBar && { "identifier": attorneyBar }), ...(attorneySchool && { "alumniOf": attorneySchool }), ...(attorneyAwards && { "award": attorneyAwards }) }, { "@type": "LegalService", "provider": { "@type": "Person", "name": attorneyName }, "areaServed": attorneyStates ? attorneyStates.split(',').map(s => ({ "@type": "State", "name": s.trim() })) : [], ...(attorneyPracticeAreas && { "serviceType": attorneyPracticeAreas.split(',').map(a => a.trim()) }) } ] }; document.getElementById('attorneyJson').innerHTML = highlightJSON(schema); document.getElementById('attorneyOutput').style.display = 'block'; } function clearAttorney() { document.querySelectorAll('#attorney input, #attorney select, #attorney textarea').forEach(el => { el.value = ''; }); document.getElementById('attorneyOutput').style.display = 'none'; } // FAQ SCHEMA function addFAQPair() { const container = document.getElementById('faqContainer'); const pairId = 'faq-' + Date.now() + Math.random(); const html = `
`; container.insertAdjacentHTML('beforeend', html); } function removeFAQPair(pairId) { document.getElementById(pairId).remove(); } function generateFAQ() { const pairs = []; document.querySelectorAll('#faqContainer .output-section').forEach(section => { const question = section.querySelector('.faq-question').value; const answer = section.querySelector('.faq-answer').value; if (question.trim() && answer.trim()) { pairs.push({ question, answer }); } }); showValidation('faqOutput', [{ id: 'faqContainer', label: 'Q&A Pairs', required: true }], 'faqValidation'); const schema = { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": pairs.map(pair => ({ "@type": "Question", "name": pair.question, "acceptedAnswer": { "@type": "Answer", "text": pair.answer } })) }; document.getElementById('faqJson').innerHTML = highlightJSON(schema); document.getElementById('faqOutput').style.display = 'block'; } // AGGREGATE RATING function generateRating() { const ratingFirmName = document.getElementById('ratingFirmName').value; const ratingValue = parseFloat(document.getElementById('ratingValue').value); const reviewCount = parseInt(document.getElementById('reviewCount').value); const bestRating = parseInt(document.getElementById('bestRating').value) || 5; const worstRating = parseInt(document.getElementById('worstRating').value) || 1; const fields = [ { id: 'ratingFirmName', label: 'Firm Name', required: true }, { id: 'ratingValue', label: 'Rating Value', required: true }, { id: 'reviewCount', label: 'Review Count', required: true } ]; const isValid = showValidation('ratingOutput', fields, 'ratingValidation'); const schema = { "@context": "https://schema.org", "@type": "LocalBusiness", "name": ratingFirmName, "aggregateRating": { "@type": "AggregateRating", "ratingValue": ratingValue, "bestRating": bestRating, "worstRating": worstRating, "ratingCount": reviewCount } }; document.getElementById('ratingJson').innerHTML = highlightJSON(schema); document.getElementById('ratingOutput').style.display = 'block'; } function clearRating() { document.querySelectorAll('#rating input').forEach(el => { el.value = ''; }); document.getElementById('bestRating').value = '5'; document.getElementById('worstRating').value = '1'; document.getElementById('ratingOutput').style.display = 'none'; }