Adding Programmatic Schema to MPG
This method involves placing a raw JSON-LD script directly into your MPG Template. Because MPG processes the entire page content, it will find your {{shortcodes}} inside the script and swap them for the correct data from your CSV/Google Sheet.
Step 1: Create Your Schema Template
First, identify which Schema type you need (LocalBusiness, Product, FAQ, etc.). Instead of using real names or addresses, use your MPG Column Headers wrapped in double curly brackets.
Example for Local Business:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "{{mpg_business_name}}",
"description": "{{mpg_service_description}}",
"url": "{{mpg_url}}",
"telephone": "{{mpg_phone}}",
"address": {
"@type": "PostalAddress",
"streetAddress": "{{mpg_street}}",
"addressLocality": "{{mpg_city}}",
"addressRegion": "{{mpg_state}}",
"postalCode": "{{mpg_zip}}",
"addressCountry": "US"
}
}
</script>
Step 2: Insert the Code into the MPG Template
- Open your MPG Template Page in the WordPress editor.
- Add a new block and search for Custom HTML.
- Paste your JSON-LD script (from Step 1) into the block.
- Update the page.
Step 3: Verify the Data Replacement
It is vital to check that the shortcodes are actually turning into data.
- Open a generated URL (e.g.,
mysite.com/service-in-chicago/). - Right-click the page and select View Page Source.
Use
Ctrl + Fto search for"@type".The Check:
- CORRECT:
"name": "Plumbing Experts Chicago" - INCORRECT:
"name": "{{mpg_business_name}}"
- CORRECT:
Step 4: Final Validation with Google
Google provides a free tool to ensure your code is formatted correctly and eligible for Rich Results.
- Copy the URL of one of your generated pages.
- Go to the Google Rich Results Test
- Paste your URL and run the test.
- If everything is green, Google can now "read" your programmatic data.
⚠️ Important: Avoid Schema Conflicts
If you are using an SEO plugin like Rank Math or Yoast SEO, you must disable the built-in Schema settings for your MPG Template page if you want to use the custom schema. Failing to do so will result in "Duplicate Schema" (e.g., two different sets of business data on one page), which can confuse search engines and negatively impact your SEO.