SEO & Structured Data Maintenance Guide
This guide explains how to maintain the structured data (JSON-LD) implementation that helps search engines understand your content better.
Quick Reference: What to Update and When
1. Personal/Professional Changes
When your professional information changes, update /src/site.config.ts
:
// SEO and structured data fields
jobTitle: "Assistant Professor of Economics", // Update when job title changes
organization: "University of Oxford", // Update when changing institutions
profileImage: "/headshot.jpg", // Update if you change the filename
twitterHandle: "@straightedge", // Update if Twitter handle changes
orcid: "0000-0003-0884-8418", // Your ORCID ID (rarely changes)
socialProfiles: [ // Add/remove social profiles
"https://twitter.com/straightedge",
"https://www.linkedin.com/in/drnathanlane/",
"https://github.com/nathanlane",
"https://orcid.org/0000-0003-0884-8418"
],
2. Adding New Content Types
If you add new types of content beyond blog posts and research papers, you’ll need to update /src/components/StructuredData.astro
.
Example: Adding structured data for project pages
case 'project':
schema = {
"@context": "https://schema.org",
"@type": "SoftwareSourceCode", // or "CreativeWork" for non-code projects
"@id": `${siteConfig.siteUrl}${data.url}#project`,
"name": data.title,
"description": data.description,
"author": personSchema,
"datePublished": data.publishDate,
"programmingLanguage": data.technologies, // ["Python", "R", etc.]
"codeRepository": data.github
};
break;
3. Testing Your Structured Data
After making changes, always test your structured data:
- Google’s Rich Results Test: https://search.google.com/test/rich-results
- Enter your URL or paste your HTML
- Check for errors or warnings
- Preview how your content might appear in search
- Schema.org Validator: https://validator.schema.org/
- More technical validation
- Shows the complete structured data tree
- Local Testing:
# Build your site
pnpm build
# Preview locally
pnpm preview
# View page source and search for "application/ld+json"
Common Maintenance Tasks
Updating After Publishing New Content
No action needed! The structured data is automatically generated for:
- New blog posts (using article schema)
- New research papers (using article schema)
- All pages (using website schema)
Adding Co-authors to Research Papers
Currently, the system only supports a single author (you). To add co-author support:
- Update the research schema in
/src/content.config.ts
to parse authors - Modify the article schema in
StructuredData.astro
to handle multiple authors
Changing Image Paths
If you reorganize where images are stored:
- Update
profileImage
insite.config.ts
- Update any OG image generation logic if paths change
What Each Schema Does
Website Schema
- Purpose: Tells Google about your site structure
- Benefits: Can enable sitelinks search box in Google results
- Maintenance: Rarely needs updates
Article Schema
- Purpose: Rich snippets for blog posts and papers
- Benefits: Shows publish date, author, reading time in search
- Maintenance: Automatic for new content
Person Schema
- Purpose: Establishes your identity as author
- Benefits: Knowledge panel potential, author attribution
- Maintenance: Update when professional info changes
Breadcrumb Schema
- Purpose: Shows page hierarchy
- Benefits: Breadcrumb trail in search results
- Maintenance: Automatic based on URL structure
Troubleshooting
Structured Data Not Appearing
- Check browser console for JavaScript errors
- View page source and search for
application/ld+json
- Ensure the component is imported in the layout
Validation Errors
- Use Google’s Rich Results Test to identify issues
- Common issues:
- Missing required fields
- Invalid date formats (use ISO 8601)
- Broken image URLs
Changes Not Reflected
- Clear your build cache:
rm -rf.astro dist
- Rebuild:
pnpm build
- Google can take days/weeks to update their index
Best Practices
- Keep it Simple: Don’t over-complicate schemas
- Be Accurate: Only include truthful, accurate information
- Stay Current: Update professional info promptly
- Test Changes: Always validate after updates
- Monitor Results: Use Google Search Console to track performance