red line

How to Add Structured Data to Your WordPress Site

Learn the what, why, and how of structured data for better content placement in search engine results and generative AI.
rubik's cube representing structured data

What is Structured Data and Why Should I Care?

Have you ever wondered how web publishers get their content into those little featured cards at the top of Search Engine Results Pages (SERP)? It might be a news article, a product for sale, or a recipe. The answer is Structured Data. Structured data (or Schema) is a small piece of code added to a web page to declare explicit information about the content of the page, such as the product price, primary photo, and review score. 

HTML

<script type=application/ld+json>

{

  @context: https://schema.org,

  @type: Product,

  aggregateRating: {

    @type: AggregateRating,

    ratingValue: 3.5,

    reviewCount: 11

  },

  description: 0.7 cubic feet countertop microwave. Has six preset cooking categories and convenience features like Add-A-Minute and Child Lock.,

  name: Kenmore White 17\ Microwave,

  image: kenmore-microwave-17in.jpg,

  offers: {

   @type: Offer,

    availability: https://schema.org/InStock,

    price: 55.00,

    priceCurrency: USD

  }

}

</script>

Search engines use this data to display the featured sections, which are called Rich Results, at the top of the SERP. Getting placed in the Rich Results  – above other listings – can bring additional traffic to your site. 

Adding Structured Data with WordPress

If you manage your website manually, you can manually add structured data to any applicable pages. If you use WordPress, it’s possible to use a code snippets plugin to manually add structured data to any applicable pages, but if you have more than a handful of pages we recommend the SEOPress PRO plugin to greatly simplify the process.

The first thing you’ll want to add is a piece of structured data to your home page to represent your organization. This will power the Rich Result representing your organization often shown in the right sidebar of SERP.

Google search of Microsoft example

You can add this with SEOPress at SEOPress > PRO > Local Business, and select your Business Type, and enter your address, contact information, and operating hours.

Automatic Structured Data

SEOPress also gives you tools to define Structured Data per post type, which will automatically be generated on those posts from the post title, featured image, custom fields, etc. This is managed at SEOPress > Schemas > Add New, and the first thing to select is the Schema Type. SEOPress provides the most common types, but you can also select Custom if you need a different type.

Next you select which post types (or categories of posts) you want the schema to apply to. For example, you’d want to use the Article schema for your News custom post type.

Then based on the schema type you select, SEOPress will prompt you to map WordPress fields to the appropriate field on the schema. So, for example, you can set the article schema headline to use the post title.

You can also set each field to manual, which you’d then manually fill in for each post in the meta box “Structured Data Types” > Automatic. If one of the posts in the post type shouldn’t use the structured data, you can disable the automatic schema here as well.

How to Manage Custom Schema with SEOPress

If SEOPress doesn’t have the schema type you need, you can use the Custom type. Then you can manually enter the schema markup, and use the variable syntax which will be replaced by the real values per post. For example, this would pull the custom field “normal_range” for each post.

HTML

<script type=application/ld+json>

{

  @context: https://schema.org,

  @type: BloodTest,

  normalRange: %%_cf_normal_range%%

}

</script>

 

More questions on setting up structured data or other ways to improve your SEO or GEO? Reach out to our team of devs, designers and digital marketers.

Effective website experiences & digital marketing strategies.