WordPress.org

Making WordPress.org

Opened 2 months ago

Last modified 2 months ago

#5604 new enhancement

Add structured data to profile pages

Reported by: 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 (5)

#1 follow-up: @JavierCasares
2 months 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
2 months 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
2 months 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
2 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.