๐๐ฑ๐ฑ ๐ฆ๐ฐ๐ต๐ฒ๐บ๐ฎ ๐๐ผ ๐ช๐ผ๐ฟ๐ฑ๐ฃ๐ฟ๐ฒ๐๐ ๐ช๐ถ๐๐ต๐ผ๐๐ ๐ฃ๐น๐๐ด๐ถ๐ป๐
Most guides tell you to use plugins for schema. Plugins slow your site. They add bloat. You do not need them.
You get full control over your data. Your site stays fast.
Use a child theme first. Updates wipe out changes in parent themes.
Three ways to add schema:
Method 1: functions.php. Open functions.php in your child theme. Add schema using the wp_head hook. This adds schema to all pages.
Method 2: header.php. Open header.php. Paste JSON-LD before the closing head tag.
Method 3: Block Editor. Use this for single pages. Add a Custom HTML block. Paste your code there.
Validate your work:
- Use Schemify Validator.
- Use Google Rich Results Test.
- Check Google Search Console.
Avoid these mistakes:
- Forget to escape quotes in PHP.
- Put schema in the body.
- Skip validation.
- Use one schema for every page.
Test on a staging site first. PHP errors cause a white screen of death.
Source: https://dev.to/schemify/how-to-add-schema-markup-to-wordpress-without-a-plugin-1hhb