Making WordPress.org

Opened 3 years ago

Closed 19 months ago

Last modified 19 months ago

#5604 closed enhancement (fixed)

Add structured data to profile pages

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by:
Milestone: Priority: low
Component: Profiles Keywords: seo
Cc:

Description (last modified by jonoaldersonwp)

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 WebSite piece for profiles.wordpress.org.
    • Alter the isPartOf property of the WebPage to reference the new WebSite piece.
    • Alter the @type of the WebPage to an array, and add ProfilePage.
    • Set the @id and url properties of the WebPage to the canonical URL of the profile page.
    • Remove the description property from the WebPage.
    • Add a Person piece, representing the person whom the profile represents.
    • Add an about property to the WebPage, referencing the Person.

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

  • The sameAs property 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.
  • We request a 500px sized version of the gravatar image.

Change History (7)

#1 follow-up: @JavierCasares
3 years ago

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...

#2 @jonoaldersonwp
3 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 @dd32
3 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?

#4 @jonoaldersonwp
3 years ago

  • Description modified (diff)

#6 @coffee2code
19 months 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:

  1. Added second WebSite section:
    		{
    			"@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"
    			}
    		},
    
  2. Changed "@type": "ProfilePage", to "@type": ["ProfilePage", "WebPage"],
  3. In ProfilePage/WebPage section:
    1. Changed the isPartOf -> @id value from 'https://wordpress.org/#website' to 'https://profiles.wordpress.org/#website'.
    2. Added the 'about' field.
    3. Omitted "- WordPress user profile" suffix from 'name' field.
    4. Note: The 'name' field value otherwise retains previous format of Example User (@example) instead of proposed Example User – @example from this ticket. If it matters, we can change it.
    5. 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.)
  4. In Person section:
    1. Added 'url' field
    2. Added 'sameAs' field, which includes user website and/or GitHub profile URL, if either exists.
    3. Changed the '@id' suffix from '#profile' to '#person'.
    4. 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.

#7 @jonoaldersonwp
19 months ago

Fantastic! :D

Note: See TracTickets for help on using tickets.