### Install and start wordpress-develop environment Source: https://developer.yoast.com/development/environment/setup-plugin-integration-tests Run these commands in your terminal within the `wordpress-develop` directory to install dependencies, build assets, and start the development environment. ```bash npm install npm run build:dev npm run env:start npm run env:install ``` -------------------------------- ### Example cURL Request for Get XML Schemamap Source: https://developer.yoast.com/features/schema/schema-aggregator/api-reference Example of how to retrieve the XML sitemap using cURL. ```shell curl https://example.com/wp-json/yoast/v1/schema-aggregator/get-xml ``` -------------------------------- ### Example cURL Requests for Get Schema Source: https://developer.yoast.com/features/schema/schema-aggregator/api-reference Examples of how to request schema data for a post type using cURL, including pagination. ```shell # Get first page of posts curl https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/post # Get second page curl https://example.com/wp-json/yoast/v1/schema-aggregator/get-schema/post/2 ``` -------------------------------- ### Install Grunt CLI Source: https://developer.yoast.com/development/environment/tools Installs the Grunt command line interface globally. Use this to manage repetitive development tasks. ```bash yarn global add grunt-cli ``` -------------------------------- ### Extended HowTo Schema Example Source: https://developer.yoast.com/features/schema/pieces/howto This snippet shows an extended example of the HowTo schema, including multiple steps with varying levels of detail and images. It is useful for complex instructions. ```json { "@context": "https://schema.org", "@graph": [ { "@type": "HowTo", "@id": "https://www.example.com/#/schema/HowTo/abc123", "mainEntityOfPage": { "@id": "https://www.example.com/#/schema/Article/abc123" }, "name": "HowTo example", "description": "HowTo description", "inLanguage": "en-US", "totalTime": "P2DT0H0M", "step": [ { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/abc123", "name": "Example step 1", "url": "https://www.example.com/example-page/#how-to-step-1", "image": { "@id": "https://www.example.com/uploads/example-image.jpg" }, "itemListElement": [ { "@type": "HowToDirection", "text": "The step description." } ] }, { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/def456", "text": "Example step 2 (no description)", "url": "https://www.example.com/example-page/#how-to-step-2", "image": { "@id": "https://www.example.com/uploads/example-image-2.jpg" } }, { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/ghi789", "name": "Example step 3", "url": "https://www.example.com/example-page/#how-to-step-3", "itemListElement": [ { "@type": "HowToDirection", "text": "The first paragrah in the step description." }, { "@type": "HowToDirection", "text": "The second paragrah in the step description." } ] } ] } ] } ``` -------------------------------- ### Install Composer Dependencies Source: https://developer.yoast.com/development/environment/tools Installs all necessary project dependencies defined in the composer.json file within a plugin directory. ```bash composer install ``` -------------------------------- ### Install Yoast SEO via Composer Source: https://developer.yoast.com/development/installation/using-composer Run this command in your plugins directory to download and install the latest version of Yoast SEO and its dependencies. ```bash composer require yoast/wordpress-seo ``` -------------------------------- ### Install Node.js using NVM Source: https://developer.yoast.com/development/environment/tools Installs a specified version of Node.js using Node Version Manager (NVM). Check the Node.js website for the latest LTS version. ```bash nvm install ``` -------------------------------- ### AggregateOffer Schema Example Source: https://developer.yoast.com/features/schema/pieces/aggregateoffer This example demonstrates the minimum required properties for an AggregateOffer schema. It includes the offer count, price range, currency, and references to individual offers by their IDs. ```json ``` ```json { "@context": "https://schema.org", "@graph": [ { "@type": "AggregateOffer", "@id": "https://www.example.com/#/schema/AggregateOffer/abc123", "lowPrice": "22.00", "highPrice": "136.00", "priceCurrency": "GBP", "offerCount": 3, "offers": [ { "@id": "https://www.example.com/#/schema/Offer/abc123" }, { "@id": "https://www.example.com/#/schema/Offer/def456" }, { "@id": "https://www.example.com/#/schema/Offer/ghi789" } ] } ] } ``` -------------------------------- ### Install JavaScript Dependencies with Yarn Source: https://developer.yoast.com/development/environment/tools Installs JavaScript dependencies for a project by running the 'yarn' command in the directory containing the package.json file. ```bash yarn ``` -------------------------------- ### Install Composer using Homebrew Source: https://developer.yoast.com/development/environment/tools Installs Composer, a package manager for PHP, globally on your system using Homebrew. ```bash brew install composer ``` -------------------------------- ### Install Xcode Command Line Tools and Build Utilities Source: https://developer.yoast.com/development/environment/tools Installs essential Xcode command line tools and utilities for building code from source on macOS. ```shell xcode-select --install ``` ```shell brew install autoconf automake libtool ``` -------------------------------- ### Install Git Version Control Source: https://developer.yoast.com/development/environment/tools Installs Git, a distributed version control system, using Homebrew. Git is essential for managing code repositories. ```shell brew install git ``` -------------------------------- ### Install Yarn using Homebrew Source: https://developer.yoast.com/development/environment/tools Installs Yarn, a package manager for JavaScript dependencies, globally using Homebrew. This method also installs Node.js. ```bash brew install yarn ``` -------------------------------- ### Configure Git Hook for Composer Install Source: https://developer.yoast.com/development/standards/version-control-conventions Create a `post-receive` Git hook to automatically run `composer install` whenever `git checkout` is executed. This ensures dependencies and autoloaders are up-to-date for Composer-based projects. ```bash cat <> .git/hooks/post-receive #!/bin/sh composer install --working-dir=$GIT_DIR/../ EOT chmod +x .git/hooks/post-receive ``` -------------------------------- ### Install PHP 7.4 using Homebrew Source: https://developer.yoast.com/development/environment/tools Installs PHP 7.4 using Homebrew after adding the unofficial Homebrew PHP tap. This is necessary for developing plugins in PHP. ```bash brew tap shivammathur/php brew install php@7.4 ``` -------------------------------- ### Minimum HowTo Schema Example Source: https://developer.yoast.com/features/schema/pieces/howto This snippet shows the minimum required properties for a HowTo schema, including steps with names and descriptions. ```json { "@context": "https://schema.org", "@graph": [ { "@type": "HowTo", "@id": "https://www.example.com/#/schema/HowTo/abc123", "mainEntityOfPage": { "@id": "https://www.example.com/example-page/" }, "name": "HowTo example", "step": [ { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/abc123", "name": "Example step 1", "url": "https://www.example.com/example-page/#how-to-step-1", "itemListElement": [ { "@type": "HowToDirection", "text": "The step description." } ] }, { "@type": "HowToStep", "text": "Example step 2 (no description)", "url": "https://www.example.com/example-page/#how-to-step-2" } ] } ] } ``` -------------------------------- ### Run Interactive Code Style Check (Free) Source: https://developer.yoast.com/development/environment/running-unit-tests-code-style-checks-and-linters Launch an interactive menu for code style checks using 'composer cs' for the free version. ```bash composer cs ``` -------------------------------- ### Install Homebrew Package Manager Source: https://developer.yoast.com/development/environment/tools Installs the Homebrew package manager on macOS. This is a prerequisite for installing many other development tools. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### WP CLI Indexing Process Output Example Source: https://developer.yoast.com/features/wp-cli/reindex-indexables This output shows the progress of the indexation process for different types of content. If a specific type is not shown, it means all items of that type were already indexed. ```bash Indexing posts 100% [==============================] 0:00 / 0:00 Indexing terms 100% [==============================] 0:00 / 0:00 Indexing post type archives 100% [=================] 0:00 / 0:00 Indexing general objects 100% [====================] 0:00 / 0:00 ``` -------------------------------- ### Install OpenSSL for XDebug SSL Permissions Source: https://developer.yoast.com/development/environment/running-unit-tests-code-style-checks-and-linters If XDebug encounters SSL permission errors, install OpenSSL using Homebrew and attempt to install XDebug again. ```bash brew install openssl ``` -------------------------------- ### Example Aggregated Schema Response Source: https://developer.yoast.com/features/schema/schema-aggregator/overview An example of the JSON-LD response when fetching aggregated schema data for posts. ```json { "@context": "https://schema.org", "@type": "Article", "@id": "https://example.com/hello-world/#article", "headline": "Hello World", "datePublished": "2026-01-15T10:30:00+00:00", "author": { "@id": "https://example.com/#/schema/person/1" } } { "@context": "https://schema.org", "@type": "Article", "@id": "https://example.com/your-second-post/#article", "headline": "The second post", "datePublished": "2026-01-15T10:30:00+00:00", "author": { "@id": "https://example.com/#/schema/person/1" } } ``` -------------------------------- ### Register Site as OAuth Client Source: https://developer.yoast.com/features/wp-cli/auth Registers the site as an OAuth client using Dynamic Client Registration. Use --force to deregister an existing client first. ```bash wp yoast auth register ``` ```bash wp yoast auth register --force ``` -------------------------------- ### Minimum Breadcrumb Schema Example Source: https://developer.yoast.com/features/schema/pieces/breadcrumb This is a basic example of a BreadcrumbList schema, including the context, graph, and list items with their positions, names, and items. ```json { "@context": "https://schema.org", "@graph": [ { "@type": "BreadcrumbList", "@id": "https://www.example.com/#/schema/BreadcrumbList/abc123", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.example.com/" }, { "@type": "ListItem", "position": 2, "name": "Example Section", "item": "https://www.example.com/example-section/" }, { "@type": "ListItem", "position": 3, "name": "Example Page" } ] } ] } ``` -------------------------------- ### Install Rosetta for Rosetta 2 Source: https://developer.yoast.com/development/environment/tools Installs Rosetta 2 on Apple Silicon Macs. This utility allows running applications compiled for Intel processors. ```shell softwareupdate --install-rosetta ``` -------------------------------- ### Install iTerm2 and Oh-My-Zsh Source: https://developer.yoast.com/development/environment/tools Installs iTerm2, an enhanced terminal emulator, and Oh-My-Zsh, a framework for managing Zsh configuration. These tools improve terminal usability and features. ```shell brew install --cask iterm2 ``` ```shell sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ``` -------------------------------- ### Minimum Recipe Schema Markup Example Source: https://developer.yoast.com/features/schema/pieces/recipe This snippet demonstrates the minimum required properties for a Recipe schema, including mainEntityOfPage, name, image, recipeIngredient, and recipeInstructions. It's useful for basic recipe indexing. ```json { "@context": "https://schema.org", "@graph": [ { "@type": "Recipe", "mainEntityOfPage": { "@id": "https://www.example.com/#/schema/Article/abc123" }, "name": "Party Coffee Cake", "image": { "@id": "https://www.example.com/uploads/example-image.jpg" }, "recipeIngredient": [ "2 cups of flour", "3/4 cup white sugar", "2 teaspoons baking powder", "1/2 teaspoon salt", "1/2 cup butter", "2 eggs", "3/4 cup milk" ], "recipeInstructions": [ { "@type": "HowToStep", "text": "Preheat the oven to 350 degrees F. Grease and flour a 9x9 inch pan.", "url": "https://example.com/example-page/#recipe-step-1" }, { "@type": "HowToStep", "text": "In a large bowl, combine flour, sugar, baking powder, and salt.", "url": "https://example.com/example-page/#recipe-step-2" }, { "@type": "HowToStep", "text": "Mix in the butter, eggs, and milk.", "url": "https://example.com/example-page/#recipe-step-3" }, { "@type": "HowToStep", "text": "Spread into the prepared pan.", "url": "https://example.com/example-page/#recipe-step-4" }, { "@type": "HowToStep", "name": "Bake", "url": "https://example.com/example-page/#recipe-step-5" }, { "@type": "HowToStep", "text": "Allow to cool and enjoy.", "url": "https://example.com/example-page/#recipe-step-6" } ] } ] } ``` -------------------------------- ### Example SEO Scores Output Source: https://developer.yoast.com/features/yoast-seo-abilities/analysis-scores This is an example of the JSON output returned by the SEO scores ability. It includes post title, score, label, and focus keyphrase. ```json [ { "title": "10 High-Protein Breakfast Ideas for Busy Mornings", "score": "good", "label": "Good", "focus_keyphrase": "High-Protein Breakfast Ideas" }, { "title": "How to Make Homemade Sourdough Bread from Scratch", "score": "bad", "label": "Needs improvement", "focus_keyphrase": "Homemade sourdough bread" }, { "title": "5 Quick and Healthy Lunch Recipes Under 30 Minutes", "score": "bad", "label": "Needs improvement", "focus_keyphrase": "Quick and Healthy Lunch Recipes" }, { "title": "The Best Budget-Friendly Pantry Staples Every Cook Needs", "score": "na", "label": "Not available", "focus_keyphrase": null } ] ``` -------------------------------- ### Event Schema Markup Example Source: https://developer.yoast.com/features/schema/pieces/event This JSON-LD snippet provides a comprehensive example of Event schema markup. Use this to detail event information for search engines. ```json { "@context": "https://schema.org", "@graph": [ { "@type": "Event", "@id": "https://www.example.com/#/schema/Event/abc123", "name": "My birthday party", "description": "We're all getting together in at Example Venue in Fake Town to celebrate my special day!", "location": { "@type": "Place", "name": "Example Venue", "address": { "@type": "PostalAddress", "streetAddress": "123 Fake Street", "addressLocality": "Fake Town", "postalCode": "12345", "addressRegion": "XY", "addressCountry": "US" } }, "startDate": "2025-07-21T19:00-05:00", "endDate": "2025-07-22T19:00-05:00", "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode", "eventStatus": "https://schema.org/EventRescheduled", "previousStartDate": "2024-07-21T19:00-05:00", "offers": { "@type": "Offer", "@id": "https://www.example.com/#/schema/Offer/abc123", "priceSpecification": { "@type": "PriceSpecification", "price": "22.00", "valueAddedTaxIncluded": "false", "priceCurrency": "GBP" }, "availability": "http://schema.org/InStock", "url": "https://www.example.com/example-product-page/", "seller": { "@id": "https://www.example.com/#/schema/Organization/1" } }, "image": { "@id": "https://www.example.com/uploads/example-image.jpg" }, "organizer": { "@id": "https://www.example.com/#/schema/Organization/1" }, "performer": { "@id": "https://www.example.com/#/schema/Person/abc123" } } ] } ``` -------------------------------- ### Git Branching Tree Example Source: https://developer.yoast.com/development/standards/version-control-conventions Illustrates the hierarchical structure of Git branches, showing main, develop, and feature branches stemming from them. ```git main | |-123-fix-typo |-132-xss-in-metabox |-... | |---trunk | |-164-add-button |-166-twitter-integration |-... ``` -------------------------------- ### Watch for Changes and Auto-Build Source: https://developer.yoast.com/development/environment/setup Starts a process that watches for changes in JavaScript files and automatically rebuilds them. ```bash yarn start ``` -------------------------------- ### Date Index Page Canonical URL Examples Source: https://developer.yoast.com/features/seo-tags/canonical-urls/functional-specification Examples of canonical URL structures for date index pages, which list posts filtered by date. These include the date component. ```text %%protocol%%//%%hostname%%/%date% ```