2 min read
·
0 views
Making SEO better for blog posts with Structured Data
Search engines like Google use structured data to understand the contents of our page better. is a format that most use to describe the data.
Structured Data
Below is an example of a piece of structured data.
_10{_10 "@context": "https://json-ld.org/contexts/person.jsonld",_10 "@id": "http://dbpedia.org/resource/John_Lennon",_10 "name": "John Lennon",_10 "born": "1940-10-09",_10 "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"_10}
Adding Structured Data in Next.js
- Create the following component
StructuredData.jsx
. Here we use the built-in component fromnext/head
to append elements to thehead
of the page.
- Use the
StructuredData
component in your respective component containing the UI for your post.
Validate Structured Data
Before deploying the changes to production, we can inspect the HTML elements on a browser to see if the changes are reflected in the <head>
section of the page.