### How-to Structured Data Block Source: https://yoast.com/seo-glossary Yoast SEO's How-to block automatically adds structured data to your WordPress content, making it eligible for rich results. Use this in the block editor for step-by-step guides. ```html

How to do something

  1. Step 1
  2. Step 2
  3. Step 3
``` -------------------------------- ### Initialize and Push Data to DataLayer Source: https://yoast.com/about-us/team/alex-moss Initializes the dataLayer if it doesn't exist and pushes user-specific data. This is commonly used for analytics and marketing tools. ```javascript var dataLayer = dataLayer || []; dataLayer.push({"logged_in":false,"currency_code":"$","currency_string":"USD","user_region":"US","yoast_seo_score":0,"yoast_readability_score":90,"yoast_cornerstone_content":true}); ``` -------------------------------- ### Initialize JavaScript Data Source: https://yoast.com/help This snippet initializes a global JavaScript variable `DAEXTHEFUP_PHPDATA` with configuration settings. It includes AJAX URL, nonces, and various other parameters for plugin functionality. ```javascript window.DAEXTHEFUP_PHPDATA = {"ajaxUrl":"https:\/\/yoast.com\/wp\/wp-admin\/admin-ajax.php","nonce":"9fb5cb7fda","uniqueSubmission":0,"cookieExpiration":3153600000,"commentForm":2,"textareaCharacters":400,"textareaLabelPositiveFeedback":"Great! We're happy to help.","textareaLabelNegativeFeedback":"We\u2019re sorry to hear that! What were you looking for?"} //# sourceURL=daexthefup-main-js-before ``` -------------------------------- ### Initialize Data Layer and Push User Data Source: https://yoast.com/academy/understanding-structured-data-training Initializes the dataLayer if it doesn't exist and pushes user-specific data. This is often used for analytics and personalization. ```javascript var dataLayer = dataLayer || []; dataLayer.push({"logged_in":false,"currency_code":"$","currency_string":"USD","user_region":"US","yoast_seo_score":81,"yoast_readability_score":90,"yoast_cornerstone_content":true}); ``` -------------------------------- ### Enable Schema Development Mode Source: https://developer.yoast.com/features/schema/api Toggle the 'yoast_seo_development_mode' filter to 'true' to enable pretty-printed Schema output for easier debugging. This is not recommended for production environments. ```php add_filter( 'yoast_seo_development_mode', '__return_true' ); ``` -------------------------------- ### JavaScript Configuration for WooCommerce Single Product Source: https://yoast.com/product/yoast-seo-wordpress JavaScript object containing internationalization strings and configuration for the WooCommerce single product page, including gallery and zoom options. ```javascript var wc_single_product_params = { "i18n_required_rating_text": "Please select a rating", "i18n_rating_options": [ "1 of 5 stars", "2 of 5 stars", "3 of 5 stars", "4 of 5 stars", "5 of 5 stars" ], "i18n_product_gallery_trigger_text": "View full-screen image gallery", "review_rating_required": "yes", "flexslider": { "rtl": false, "animation": "slide", "smoothHeight": true, "directionNav": false, "controlNav": "thumbnails", "slideshow": false, "animationSpeed": 500, "animationLoop": false, "allowOneSlide": false }, "zoom_enabled": "1", "zoom_options": [], "photoswipe_enabled": "1", "photoswipe_options": { "shareEl": false, "closeOnScroll": false, "history": false, "hideAnimationDuration": 0, "showAnimationDuration": 0 }, "flexslider_enabled": "1" }; //# sourceURL=wc-single-product-js-extra ``` -------------------------------- ### Detect Yoast FAQ Block on Page Source: https://developer.yoast.com/features/schema/api Use the `wpseo_pre-schema_block-type_` action to detect if a specific block type, like the FAQ block, is present on the page. This allows for conditional schema modifications. ```php add_action( 'wpseo_pre-schema_block-type_yoast/faq-block', [ $this, 'prepare_faq_schema' ], 10, 1 ); ``` -------------------------------- ### WebPage Schema with Course Information Source: https://yoast.com/academy/understanding-structured-data-training This JSON-LD snippet defines a WebPage with ItemPage and Course schema. It includes details like title, URL, publication dates, images, and breadcrumbs. ```json {"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","ItemPage"],"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/","url":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/","name":"Understanding structured data training • Yoast","isPartOf":{"@id":"https:\/\/yoast.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#primaryimage"},"image":{"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#primaryimage"},"thumbnailUrl":"https:\/\/yoast.com\/app\/uploads\/2021\/05\/understanding_structured_data_my_yoast.png","datePublished":"2025-07-01T08:00:20+00:00","dateModified":"2025-07-01T08:00:31+00:00","description":"In the Understanding structured data course, you'll learn all about the concepts and terms related to structured data.","breadcrumb":{"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/yoast.com\/academy\/understanding-structured-data-training\/"],"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#\/schema\/readaction"}],"mainEntityOfPage":{"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#\/schema\/course"},"about":{"@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#\/schema\/course"}},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#primaryimage","url":"https:\/\/yoast.com\/app\/uploads\/2021\/05\/understanding_structured_data_my_yoast.png","contentUrl":"https:\/\/yoast.com\/app\/uploads\/2021\/05\/understanding_structured_data_my_yoast.png","width":640,"height":337},{"@type":"BreadcrumbList","@id":"https:\/\/yoast.com\/academy\/understanding-structured-data-training\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/yoast.com\/"},{"@type":"ListItem","position":2,"name":"SEO training","item":"https:\/\/yoast.com\/academy\/"},{"@type":"ListItem","position":3,"name":"Understanding structured data training"}]},{"@type":"WebSite","@id":"https:\/\/yoast.com\/#website","url":"https:\/\/yoast.com\/","name":"Yoast","description":"SEO for everyone","publisher":{"@id":"https:\/\/yoast.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/yoast.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US","copyrightHolder":{"@id":"https:\/\/yoast.com\/#organization"}},{"@type":["Organization","Brand"],"@id":"https:\/\/yoast.com\/#organization","name":"Yoast","url":"https:\/\/yoast.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/yoast.com\/#\/schema\/logo\/image\/","url":"https:\/\/yoast.com\/app\/uploads\/2020\/09\/Yoast_Icon_SocialMedia_500x500.png","contentUrl":"https:\/\/yoast.com\/app\/uploads\/2020\/09\/Yoast_Icon_SocialMedia_500x500.png","width":500,"height":500,"caption":"Yoast"},"image":{"@id":"https:\/\/yoast.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/yoast","https:\/\/x.com\/yoast","https:\/\/www.instagram.com\/yoast\/","https:\/\/www.linkedin.com\/company\/1414157\/","https:\/\/www.pinterest.com\/yoast\/","https:\/\/www.youtube.com\/yoast","https:\/\/en.wikipedia.org\/wiki\/Yoast","https:\/\/www.tiktok.com\/@yoastseo","https:\/\/g.co\/kgs\/4H5sG2","https:\/\/g.co\/kgs\/a9XfUu"],"numberOfEmployees":86,"founder":{"@type":"Person","name":"Joost de Valk","sameAs":"https:\/\/en.wikipedia.org\/wiki\/Joost_de_Valk"},"foundingDate":"2010-05-01","slogan":"SEO for Everyone","description":"Yoast helps you with your website optimization, whether it be through our widely used SEO software or our online SEO courses: we're here to help.","legalName":"Yoast BV","parentOrganization":{"@type":"Organization","name":"Newfold Digital","description":"Newfold Digital is a leading web presence solutions provider serving millions of small-to-medium businesses"}}]} ``` -------------------------------- ### Yoast SEO for Shopify Course Content Source: https://yoast.com/academy/yoast-seo-for-shopify-course This JSON object defines prefetching strategies for website resources. It specifies which documents to prefetch based on certain criteria, aiming to improve loading performance. ```json {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/\*"},{"not":{"href_matches":["/wp/wp-\*.php","/wp/wp-admin/\*","/app/uploads/\*","/app/\*","/app/plugins/\*","/app/themes/yoast-com/\*","/app/themes/yoast-theme/\*","/\*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} ``` -------------------------------- ### JavaScript Configuration for Yoast.com Source: https://yoast.com/product/yoast-seo-wordpress JavaScript object containing site-specific configurations for yoast.com, specifically for the shop switcher functionality. ```javascript var shop_switcher = { "cookie_domain": ".yoast.com" }; //# sourceURL=yoast-com-js-extra ``` -------------------------------- ### Schema Markup for Yoast SEO Premium Product Source: https://yoast.com/product/yoast-seo-premium-wordpress This JSON-LD script provides structured data for the Yoast SEO Premium product. It includes details like product name, URL, description, pricing, availability, and seller information, which helps search engines understand the product better. ```json {"@context":"https:\/\/schema.org","@graph":[{"@type":"Product","@id":"https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/#product","name":"Yoast SEO Premium","url":"https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/","description":"Drive more traffic and outperform competitors with Yoast SEO Premium. Automate technical SEO, optimize multiple keywords, and make content optimization seamless.\r\n ","image":{"@id":"https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/#primaryimage"},"sku":"82112","offers":[{"@type":"Offer","priceSpecification":[{"@type":"UnitPriceSpecification","price":"118.80","priceCurrency":"USD","valueAddedTaxIncluded":false}]},"availability":"http:\/\/schema.org\/InStock","url":"https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/","seller":{"@id":"https:\/\/yoast.com\/#organization"},"@id":"https:\/\/yoast.com\/#\/schema\/offer\/4113952-0"}]},{"@type":"WebSite","@id":"https:\/\/yoast.com\/#website","url":"https:\/\/yoast.com\/","name":"Yoast","publisher":{"@id":"https:\/\/yoast.com\/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/yoast.com\/?s={search_term_string}"}}}]} ```