#5604 closed enhancement (fixed)
Add structured data to profile pages
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | low | |
| Component: | Profiles | Keywords: | seo |
| Cc: |
Description (last modified by )
We should add structured data to profile pages, as part of a bigger project to add structured data throughout the wp.org ecosystem.
Specifically, we should:
- Duplicate the markup currently used on the wordpress.org homepage.
- Adapt and extend that as follows:
- Add a
WebSitepiece for profiles.wordpress.org. - Alter the
isPartOfproperty of theWebPageto reference the newWebSitepiece. - Alter the
@typeof theWebPageto an array, and addProfilePage. - Set the
@idandurlproperties of theWebPageto the canonical URL of the profile page. - Remove the
descriptionproperty from theWebPage. - Add a
Personpiece, representing the person whom the profile represents. - Add an
aboutproperty to theWebPage, referencing thePerson.
- Add a
Example output
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [{
"@type": "Organization",
"@id": "https://wordpress.org/#organization",
"url": "https://wordpress.org/",
"name": "WordPress",
"logo": {
"@type": "ImageObject",
"@id": "https://wordpress.org/#logo",
"url": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png"
},
"sameAs": [
"https://www.facebook.com/WordPress/",
"https://twitter.com/WordPress",
"https://en.wikipedia.org/wiki/WordPress"
]
},
{
"@type": "WebSite",
"@id": "https://wordpress.org/#website",
"url": "https://wordpress.org/",
"name": "WordPress.org",
"publisher": {
"@id": "https://wordpress.org/#organization"
}
},
{
"@type": "WebSite",
"@id": "https://profiles.wordpress.org/#website",
"url": "https://profiles.wordpress.org/",
"name": "WordPress.org Profiles",
"isPartOf": {
"@id": "https://wordpress.org/#website"
},
"publisher": {
"@id": "https://wordpress.org/#organization"
}
},
{
"@type": ["ProfilePage", "WebPage"],
"@id": "https://profiles.wordpress.org/matt/",
"url": "https://profiles.wordpress.org/matt/",
"inLanguage": "en",
"name": "Matt Mullenweg – @matt",
"isPartOf": {
"@id": "https://profiles.wordpress.org/#website"
},
"about": {
"@id": "https://profiles.wordpress.org/matt/#person"
}
},
{
"@type": "Person",
"@id": "https://profiles.wordpress.org/matt/#person",
"url": "https://profiles.wordpress.org/matt/",
"name": "Matt Mullenweg",
"image": "https://secure.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=500",
"sameAs": [
"https://ma.tt/"
]
}
]
}
</script>
Special considerations
- When a
Personlacks anamevalue, use their handle instead, omitting the@symbol (e.g., for https://profiles.wordpress.org/tzafrir/, usetzafrir).
- The
sameAsproperty should contain an array of every known URL representing that user. This should use the 'real' user URL (not the obfuscated URL), and their GitHub profile if provided.- If there are no
sameAsvalues, omit the property. - NB, adding social profiles to this is bottlenecked by https://meta.trac.wordpress.org/ticket/4278.
- If there are no
- We request a 500px sized version of the gravatar image.
Change History (7)
#2
@
5 years ago
Yes, but that'll introduce a lot of additional complexity and edge-cases at this stage. Baby steps ;)
#3
in reply to:
↑ 1
@
5 years ago
Replying to JavierCasares:
We should also add some information to the "Person", like "sameAs" if there is a website, or social links, "homeLocation -> address" as a general Location...
Just noting that adding the users Website or GitHub can be done easily, however, Social media links that are pulled from Gravatar are not accessible to the theme template.
@jonoaldersonwp Can you update this with an example of including those details?
#6
@
3 years ago
- Resolution set to fixed
- Status changed from new to closed
This appears to be a duplicate of #4280 but with some differences. That ticket had been largely implemented about a year and a half ago (but after this ticket was created) (except for the 'sameAs' section having social media accounts, for the same reasons noted above).
Since this is a later version of the schema, I updated the existing output in [19527-dotorg] to account for the differences. These consist of:
- Added second
WebSitesection:{ "@type": "WebSite", "@id": "https://profiles.wordpress.org/#website", "url": "https://profiles.wordpress.org/", "name": "WordPress.org Profiles", "isPartOf": { "@id": "https://wordpress.org/#website" }, "publisher": { "@id": "https://wordpress.org/#organization" } }, - Changed
"@type": "ProfilePage",to"@type": ["ProfilePage", "WebPage"], - In
ProfilePage/WebPagesection:- Changed the
isPartOf -> @idvalue from 'https://wordpress.org/#website' to 'https://profiles.wordpress.org/#website'. - Added the 'about' field.
- Omitted "- WordPress user profile" suffix from 'name' field.
- Note: The 'name' field value otherwise retains previous format of
Example User (@example)instead of proposedExample User – @examplefrom this ticket. If it matters, we can change it. - Note: Retained the 'description' field, which had been implemented. (The request to remove the 'description' field in this ticket appeared to stem more from defining how this Profiles schema differed from the w.org homepage schema, and not as an update to the previous ticket.)
- Changed the
- In
Personsection:- Added 'url' field
- Added 'sameAs' field, which includes user website and/or GitHub profile URL, if either exists.
- Changed the '@id' suffix from '#profile' to '#person'.
- Note: Retained previously defined fields: 'jobTitle', 'worksFor', 'mainEntityOfPage'
Except for the noted exceptions (namely things kept from the original request), I believe everything requested here has been implemented (barring the implementation of #4278). As such, I'm closing this is fixed.
We should also add some information to the "Person", like "sameAs" if there is a website, or social links, "homeLocation -> address" as a general Location...