How to import and export Structured Data

Since version 2.13.0, SNIP can import and export Global Snippets. Here I want to show you how this works.

How to export a Global Snippet

That one is super easy:

  1. Go to “Global Snippets” in your WordPress dashboard.
  2. Open up a Global Snippet.
  3. Scroll down until you see the Import / Export metabox.
  4. Click the Export-Button.
  5. SNIP will then load the export-code into the textarea field.
  6. You can then copy&paste it anywhere.

How to import a Global Snippet

There a re two possibilities on how you can do that:

A) Import from plain JSON-LD code

An awesome feature of SNIP is that it can not only import from it’s own exported format but also from plain JSON-LD code that you can find from around the web.

So let’s say you have this code here:

{
    "@context": "http://schema.org",
    "@type": "Product",
    "sku": "Plugin",
    "name": "SNIP - Structured Data WordPress Plugin",
    "aggregateRating": {
        "@context": "http://schema.org",
        "@type": "AggregateRating",
        "ratingValue": "4.5",
        "bestRating": "5",
        "reviewCount": "58",
        "worstRating": "1"
    },
    "offers": {
        "@context": "http://schema.org",
        "@type": "Offer",
        "priceCurrency": "USD",
        "price": "59",
        "category": "Plugin"
    },
    "description": "Allows you to create Structured Data right within WordPress."
}

Just copy and paste it into the textarea field and click the Import button. That’s basically it!

B) Import from SNIP export

Of course SNIP can also import its own export-files. Just enter the export-data into the textarea field an click the Import button.

Here is an example code:

{
    "id": "snip-31",
    "context": "http://schema.org",
    "type": "Product",
    "sku-prop-5ce3acf43d960": {
        "0": "textfield",
        "1": "Plugin",
        "overridable": false,
        "overridable_multiple": false
    },
    "name-prop-1": {
        "0": "textfield",
        "1": "SNIP - Structured Data WordPress Plugin",
        "overridable": false,
        "overridable_multiple": false
    },
    "aggregateRating-prop-2": {
        "0": "",
        "1": {
            "id": "snip-35",
            "context": "http://schema.org",
            "type": "AggregateRating",
            "ratingValue-prop-5ce3acf43d3df": {
                "0": "textfield",
                "1": "4.5",
                "overridable": false,
                "overridable_multiple": false
            },
            "bestRating-prop-1": {
                "0": "textfield",
                "1": "5",
                "overridable": false,
                "overridable_multiple": false
            },
            "reviewCount-prop-2": {
                "0": "textfield",
                "1": "58",
                "overridable": false,
                "overridable_multiple": false
            },
            "worstRating-prop-3": {
                "0": "textfield",
                "1": "1",
                "overridable": false,
                "overridable_multiple": false
            }
        },
        "overridable": false,
        "overridable_multiple": false
    },
    "offers-prop-3": {
        "0": "",
        "1": {
            "id": "snip-41",
            "context": "http://schema.org",
            "type": "Offer",
            "priceCurrency-prop-5ce3acf43d8b0": {
                "0": "textfield",
                "1": "USD",
                "overridable": false,
                "overridable_multiple": false
            },
            "price-prop-1": {
                "0": "textfield",
                "1": "59",
                "overridable": false,
                "overridable_multiple": false
            },
            "category-prop-2": {
                "0": "textfield",
                "1": "Plugin",
                "overridable": false,
                "overridable_multiple": false
            }
        },
        "overridable": false,
        "overridable_multiple": false
    },
    "description-prop-4": {
        "0": "textfield",
        "1": "Allows you to create Structured Data right within WordPress.",
        "overridable": false,
        "overridable_multiple": false
    },
    "_is_export": true
}

And this is how it looks like: