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

  1. Open your MPG Template Page in the WordPress editor.
  2. Add a new block and search for Custom HTML.
  3. Paste your JSON-LD script (from Step 1) into the block.
  4. Update the page.

Step 3: Verify the Data Replacement

It is vital to check that the shortcodes are actually turning into data.

  1. Open a generated URL (e.g., mysite.com/service-in-chicago/ ).
  2. Right-click the page and select View Page Source.
  3. Use Ctrl + F  to search for "@type" .

    The Check:

    • CORRECT: "name": "Plumbing Experts Chicago"
    • INCORRECT: "name": "{{mpg_business_name}}"

Step 4: Final Validation with Google

Google provides a free tool to ensure your code is formatted correctly and eligible for Rich Results.

  1. Copy the URL of one of your generated pages.
  2. Go to the Google Rich Results Test
  3. Paste your URL and run the test.
  4. 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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us