Going Beyond The Options – The Schema Shortcode

The WPSSO Core plugin and its WPSSO Schema JSON-LD Markup add-on do an outstanding job of analyzing your content and pulling out information about images, videos, authors, publishers, locations, events, recipes, e-commerce products, SEO customizations, and much, much more — not just from WordPress, but from many 3rd party plugins and services as well. ;-)

The following modules are included with the Pro version of WPSSO Core, and are automatically loaded if/when the supported plugins and/or services are required.

  • Integration with 3rd Party Plugins
    • All in One SEO Pack
    • bbPress
    • BuddyPress (including Group Forum Topics)
    • Co-Authors Plus (including Guest Authors)
    • Easy Digital Downloads
    • Gravity Forms + GravityView
    • HeadSpace2 SEO
    • MarketPress – WordPress eCommerce
    • NextCellent Gallery – NextGEN Legacy
    • NextGEN Gallery
    • Polylang
    • rtMedia for WordPress, BuddyPress and bbPress
    • The Events Calendar
    • The SEO Framework
    • WooCommerce (versions 1, 2, and 3)
    • WP eCommerce
    • WP Meta SEO
    • WP-PostRatings
    • Yoast SEO (aka WordPress SEO)
    • Yotpo Social Reviews for WooCommerce
  • Integration with Service APIs
    • Bitly
    • Facebook Embedded Videos
    • Google URL Shortener
    • Gravatar (Author Image)
    • Ow.ly
    • Slideshare Presentations
    • Soundcloud Tracks (for Twitter Player Card)
    • TinyURL
    • Vimeo Videos
    • Wistia Videos
    • WordPress Video Shortcode (and Self-Hosted Videos)
    • Your Own URL Shortener (YOURLS)
    • YouTube Videos and Playlists

The WPSSO JSON Pro add-on includes additional 3rd party integration modules:

  • Integration with 3rd Party Plugins
    • Simple Job Board
    • WP Job Manager
    • WP Product Review
    • WP Recipe Maker
    • WP Ultimate Recipe

The Document SSO (Social and Search Optimization) Metabox

An example SSO metabox for a Schema Product.

Most of the information gathered by the WPSSO Core plugin and its WPSSO JSON add-on is available for customizing in the Document SSO metabox — which is included on all post / page, term, and user editing pages by default (including custom post types and custom taxonomy terms) — but what happens when you need to customize a specific and unique Schema property that isn’t shown in the Document SSO metabox?

Most of the standard / popular properties are available for customizing, but on occasion, you may have some content that needs a bit of extra markup. For these cases, you have two options:

  1. If you have a WPSSO Schema JSON-LD Markup Pro add-on license, you can open a new ticket on the Pro support website and request the additional property.

    If we believe that other WPSSO JSON Pro customers could also benefit from having this property available for customizing, we’ll be happy to add it for you. ;-)

  2. Or, you can use one or more [schema] shortcodes in your content.

The Schema Shortcode

You can find complete documentation for the [schema] shortcode here, or under the WordPress SSO > Schema Shortcode menu item (provided the WPSSO JSON add-on is active).

I’ll try not to repeat the same information here, and instead, I’ll use specific examples to show what the shortcode is capable of. ;-) If there’s enough demand, one or more of these examples could become available in the Document SSO metabox in the future.

At the end of this article, you can view a snippet of the JSON that all these examples together would create in the main webpage Schema JSON-LD block. ;-)

Suggest a Gender for Google Merchant

Let’s say the current Schema Product page is a man’s watch — you could add a suggested audience property for Google Merchant using this example.

Note that all shortcode attributes are considered to be Schema property names, except for the ‘prop’ and ‘type’ attribute names, which have special meaning to the shortcode parser. So, in this example we are adding a new Schema type to the “audience” property, and in that Schema type, defining a “suggestedGender” property value.

Add an Expiration Date

Let’s say your content is set to expire on a specific date. You can easily add a new property to the main Schema type using an example like this.

Define an Important Part

Sometimes you may want to tell Google about an important part for your content. Here’s an example which defines an image in your content as a Schema Map. The image was added using the standard WordPress “Add Media” button, then a [schema][/schema] shortcode was added to “wrap” and define that block of content. Don’t forget to terminate the shortcode enclosure — it can be easy to forget that closing [/schema] tag. ;-)

Add Customer Reviews

There are several plugins available to manage customer reviews for your content, including WPSSO’s own WPSSO Ratings and Reviews add-on — along with WPSSO Core Pro supported plugins like:

If you prefer not to use a plugin, and instead manage reviews in your content manually, the following example should give you a general idea of what’s possible. Note the use of a leading “+” sign in the first [schema] shortcode ‘prop’ attribute — this tells WPSSO JSON to add this property as an array, so several reviews can be included this way.

WPSSO JSON handles nested shortcodes, but WordPress does not, so nested shortcodes must be numbered for WordPress (schema, schema_1, schema_2, etc.). Again, don’t forget to terminate the shortcode enclosure — it can be easy to forget that closing [/schema] tag. ;-)

The Schema JSON-LD

And lastly, here’s a snippet of the JSON that all these examples together would create in the main webpage Schema JSON-LD block. ;-)

Note that WPSSO Core and WPSSO JSON detect image IDs in the content, so information about the image from the Media Library can be included in the Schema markup. This makes for great SEO. And, because WPSSO Core Pro also come with many video service API modules (YouTube, Vimeo, Wistia, etc.), complete SEO markup can also be added for any embedded videos. ;-)