Warning: Constant DISALLOW_FILE_EDIT already defined in /home/u193111768/domains/flawlessthemes.com/public_html/wp-config.php on line 111
How to Manually Set Up Schema Markup in WordPress - Flawless Themes
Manually Set Up Schema Markup

How to Manually Set Up Schema Markup in WordPress

Most people ignore setting up Schema markup on their websites, assuming it never helps them. However, Schema markup helps search engines understand your website better by adding extra details to your pages. It makes your content look rich and noticeable to customers viewing the featured snippet. You have come to the right place if you struggle to set up Schema Markup in WordPress manually. Setting up manually may help your site load faster, as schema plugins can make it heavier due to their unoptimized scripts. However, it is a manual process and will take time to implement for all pages. But with the right script, you can manually set up Schema Markup on your WordPress site.

This guide will walk you through manually setting up Schema Markup in WordPress.

What is Schema Markup?

Schema markup is a unique code added to your website’s HTML that helps search engines display richer results. For example, if you add schema to a recipe page, search engines can directly show details like ingredients and cooking time in search results. This makes your listing more attractive and can lead to more clicks, whether you want to implement a recipe or product schema. If you want to use a Schema-friendly WordPress theme, you can buy one from WordPress.org. The image below shows how a Schema Markup looks when you implement it on your website. It helps your audience get a complete picture of your content without clicking the link. This does not appear randomly, but when the keyword’s intent matches your website’s content, the search engine pushes your content as a featured snippet. Various types of schema are available for your WordPress site.

Featured Snippet
This is how a well-set-up Schema Markup looks.

Types of Schema Markup

Common types include:

  • Article
  • Product
  • Event
  • Organization
  • Local Business
  • Recipe
  • Review

Here, you can go into detail to learn about Schemas’ organization.

How Schema Markup Works

  1. Structured Data: Schema markup uses a standardized format known as “structured data,” which search engines can easily interpret. This format involves adding special tags to your HTML code.
  2. Rich Snippets: When search engines understand your content better, they can present it in enhanced ways called “rich snippets.” For instance, if you have a recipe on your page and use schema markup, search engines might show the recipe’s image, ingredients, and cooking time in the search results. This makes your listing more appealing.

Examples of Schema Markup

  • Recipe: Schema markup can include ingredients, cooking time, and nutrition facts for a recipe page.
  • Product: For an e-commerce site, schema can highlight product reviews, prices, and availability.
  • Event: For an event page, schema can show dates, locations, and ticket prices.

Benefits of Schema Markup

  • Better Search Results: It makes your search results more informative and visually engaging, increasing the chances that users will click on your link.
  • Improved SEO: While schema markup doesn’t directly impact rankings, better search results can lead to more clicks, positively affecting your SEO.
  • Enhanced User Experience: Provides users with helpful information in the search results, improving their overall experience.

Preparing for Schema Markup

Before adding schema to your WordPress site, decide which type you need for your content. Use Google’s Structured Data Markup Helper to generate the necessary code.

Manually Set Up Schema Markup

  1. Create a Child Theme: Using a child theme ensures your changes are safe during theme updates.
    • Go to wp-content/themes and create a folder for your child’s theme.
    • Add a style.css file with this content:
      /*
      Theme Name: Your Theme Name Child
      Template: your-theme-name
      */

    • Create a functions.php file in the same folder to include the parent theme’s styles:
      <?php
      add_action('wp_enqueue_scripts', 'enqueue_parent_styles');
      function enqueue_parent_styles()
      {
      wp_enqueue_style('parent-style', get_template_directory_uri().'/style.css');
      }
      ?>
  2. Add Schema Markup to Your Theme: Identify where to add schema. For instance, for an Article schema:
    • Locate your single post template file (single.php or content-single.php).
    • Edit the file and insert the schema code:
      <article itemscope itemtype="http://schema.org/Article">
      <header>
      <h1 itemprop="headline"><?php the_title(); ?></h1>
      <meta itemprop="author" content="<?php the_author(); ?>" />
      <meta itemprop="datePublished" content="<?php the_time('c'); ?>" />
      </header>
      <div itemprop="articleBody">
      <?php the_content(); ?>
      </div>
      </article>
  3. Validate Your Schema Markup: After adding the schema, check it for errors.
  4. Monitor and Maintain: Regularly check and update your schema markup to keep it current with schema.org standards.

Conclusion

Each schema requires a different setup, like the local business schema code placed on the home page, the post schema going to blogs, the product schema going to the product page, and so on. Adding schema markup to WordPress can seem tricky, but this guide simplifies the process. These steps will improve your SEO and make your search results more engaging. To keep your site performing at its best, regularly validate your markup and stay informed about updates. In WordPress, you can use plugins like Yoast or Rankmath to manage the schema. You can even have a schema plugin that comes with advanced customization. All in all, you get noticed when you set up your page for a featured snippet.


Deprecated: Return type of Timber\QueryIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/u193111768/domains/flawlessthemes.com/public_html/wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/lib/QueryIterator.php on line 137

Deprecated: Return type of Timber\QueryIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/u193111768/domains/flawlessthemes.com/public_html/wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/lib/QueryIterator.php on line 150

Deprecated: Return type of Timber\QueryIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/u193111768/domains/flawlessthemes.com/public_html/wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/lib/QueryIterator.php on line 156

Deprecated: Return type of Timber\QueryIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/u193111768/domains/flawlessthemes.com/public_html/wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/lib/QueryIterator.php on line 133

Deprecated: Return type of Timber\QueryIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/u193111768/domains/flawlessthemes.com/public_html/wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/lib/QueryIterator.php on line 152

Deprecated: Return type of Timber\QueryIterator::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/u193111768/domains/flawlessthemes.com/public_html/wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/lib/QueryIterator.php on line 202