📋 Schema Markup
Implement structured data for rich search results
Master JSON-LD, microdata, and Schema.org vocabulary
Learning Objectives
- Understand structured data and its benefits
- Master JSON-LD implementation
- Learn Schema.org vocabulary
- Implement various schema types
- Create rich snippets for search results
- Test and validate schema markup
- Handle dynamic schema generation
- Optimize for voice search
Understanding Schema Markup
Schema markup is a semantic vocabulary of tags (microdata) that you can add to your HTML to improve the way search engines read and represent your page in SERPs.
Why Schema Markup Matters
- Rich Snippets: Enhanced search results with additional information
- Better CTR: Rich results can increase click-through rates by 30%
- Voice Search: Structured data helps voice assistants understand content
- Knowledge Graph: Helps Google build connections between entities
- Featured Snippets: Increases chances of appearing in position zero
Key Fact
Common Schema Types
📄 Article
Blog posts, news articles, and written content
- Headline
- Author
- Date published
- Featured image
🏢 Organization
Business and company information
- Name and logo
- Contact info
- Social profiles
- Location
👤 Person
Author and individual profiles
- Name
- Job title
- Biography
- Social links
📍 LocalBusiness
Physical business locations
- Address
- Opening hours
- Phone number
- Service area
🛍️ Product
E-commerce and product pages
- Price
- Availability
- Reviews
- SKU
⭐ Review
Ratings and reviews
- Rating value
- Review body
- Author
- Date
📅 Event
Conferences, concerts, meetups
- Start/end date
- Location
- Ticket info
- Performers
❓ FAQPage
Frequently asked questions
- Questions
- Answers
- Categories
- Author
🍞 BreadcrumbList
Site navigation path
- Item positions
- Names
- URLs
- Hierarchy
Event Schema Implementation
Complete Event Schema
<?php
/**
* Event schema for event posts
*/
function mytheme_event_schema() {
if ( ! is_singular( 'event' ) ) {
return;
}
global $post;
$schema = array(
'@context' => 'https://schema.org',
'@type' => 'Event',
'name' => get_the_title(),
'description' => get_the_excerpt(),
'image' => get_the_post_thumbnail_url( null, 'full' ),
'startDate' => get_post_meta( $post->ID, 'event_start_date', true ),
'endDate' => get_post_meta( $post->ID, 'event_end_date', true ),
'eventStatus' => 'https://schema.org/EventScheduled',
'eventAttendanceMode' => 'https://schema.org/OfflineEventAttendanceMode',
'location' => array(
'@type' => 'Place',
'name' => get_post_meta( $post->ID, 'venue_name', true ),
'address' => array(
'@type' => 'PostalAddress',
'streetAddress' => get_post_meta( $post->ID, 'venue_street', true ),
'addressLocality' => get_post_meta( $post->ID, 'venue_city', true ),
'addressRegion' => get_post_meta( $post->ID, 'venue_state', true ),
'postalCode' => get_post_meta( $post->ID, 'venue_zip', true ),
'addressCountry' => 'US'
)
),
'organizer' => array(
'@type' => 'Organization',
'name' => get_bloginfo( 'name' ),
'url' => home_url()
),
'offers' => array(
'@type' => 'Offer',
'name' => 'General Admission',
'price' => get_post_meta( $post->ID, 'ticket_price', true ),
'priceCurrency' => 'USD',
'validFrom' => get_post_meta( $post->ID, 'ticket_sale_start', true ),
'url' => get_post_meta( $post->ID, 'ticket_url', true ),
'availability' => 'https://schema.org/InStock'
),
'performer' => array(
'@type' => 'Person',
'name' => get_post_meta( $post->ID, 'performer_name', true )
)
);
echo '<script type="application/ld+json">' . "\n";
echo json_encode( $schema, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES );
echo "\n" . '</script>' . "\n";
}
add_action( 'wp_head', 'mytheme_event_schema' );
Schema Implementation Checklist
- Identify appropriate schema types for content
- Implement Organization schema on homepage
- Add Article schema to blog posts
- Include author and publisher information
- Add breadcrumb schema for navigation
- Implement search action schema
- Include images with proper dimensions
- Add dates in ISO 8601 format
- Test with Rich Results Test tool
- Validate with Schema.org validator
- Monitor in Search Console
- Check for errors and warnings
- Update schema for content changes
- Add FAQ schema where appropriate
- Implement review schema for products
- Include local business information
- Add event schema for events
- Test on multiple devices
- Document schema implementation
- Keep schema up to date
Best Practices
Schema Markup Best Practices
- Be accurate: Only mark up content visible on the page
- Be complete: Include all required properties
- Be specific: Use the most specific schema type
- Stay updated: Schema.org evolves regularly
- Test thoroughly: Validate before deploying
- Monitor performance: Track rich snippet appearance
- Avoid spam: Don't mark up hidden or misleading content
- Use JSON-LD: Google's recommended format
- Keep it simple: Start with basic schemas
- Be consistent: Use the same format throughout
Never mark up content that isn't visible to users or provide misleading information. This can result in manual actions from Google.
Start with the most important pages (homepage, main products, popular articles) and gradually expand schema coverage across your site.
Practice Exercise
Implement Complete Schema Markup