'"}

↑ ↓ select, Enter open, Esc close

Extract the structured data (JSON-LD) of a page

Adjust the values, the command updates live
user@server
curl -s https://example.com/ | tr '\n' ' ' | grep -oP '<script[^>]*application/ld\+json[^>]*>.*?</script>'

Pulls all <script type="application/ld+json"> blocks from the HTML. This quickly shows which schema types are output and whether several plugins generate duplicate markup. Google’s Rich Results Test then checks validity for rich results.

Note: For readable output, strip the tags with sed -E 's/<[^>]+>//g' and pipe the result to jq . (package jq). Microdata and RDFa are not covered.

Also searched as

  • check schema markup command line
  • show structured data of a page
  • extract json-ld from html
  • which schema does my seo plugin output

Related one-liners

All in SEO checks

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.