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.
Using Rank Math Schema Generator
MPG placeholders also work in Rank Math Schema Generator fields. You can add values such as {{mpg_business_name}}, {{mpg_city}}, or {{mpg_phone}} inside Rank Math schema fields on the template page, and MPG will replace them in Rank Math's JSON-LD output for each generated URL.
After saving the template, open a generated MPG URL and use View Page Source or Google's Rich Results Test to confirm the JSON-LD contains real row values instead of raw {{mpg_...}} placeholders.
⚠️ Important: Avoid Schema Conflicts
If you add raw JSON-LD in the MPG template and also enable schema output in an SEO plugin like Rank Math or Yoast SEO, disable one schema source for the same entity. Outputting both can create "Duplicate Schema" (for example, two different sets of business data on one page), which can confuse search engines and negatively impact your SEO.
