Person Structured Data for a Personal Brand
Adds Person JSON-LD describing you (name, job title, photo, employer and social profiles) to your About page and homepage, for personal sites and portfolios.
Opens WPIDE on
Code
// Your details.
$wpide_person = array(
'name' => 'Jane Doe',
'job_title' => 'Freelance Web Designer',
'image' => home_url( '/wp-content/uploads/jane-doe.jpg' ),
'works_for' => 'Doe Studio',
'same_as' => array( 'https://www.linkedin.com/in/janedoe', 'https://github.com/janedoe' ),
'about' => 'about', // Slug of your About page.
);
add_action( 'wp_head', function () use ( $wpide_person ) {
if ( ! is_front_page() && ! is_page( $wpide_person['about'] ) ) {
return;
}
$data = array(
'@context' => 'https://schema.org',
'@type' => 'Person',
'@id' => home_url( '/#person' ),
'name' => $wpide_person['name'],
'url' => home_url( '/' ),
'jobTitle' => $wpide_person['job_title'],
'image' => $wpide_person['image'],
'sameAs' => array_values( array_filter( $wpide_person['same_as'] ) ),
);
if ( $wpide_person['works_for'] ) {
$data['worksFor'] = array( '@type' => 'Organization', 'name' => $wpide_person['works_for'] );
}
echo '<script type="application/ld+json">' . wp_json_encode( array_filter( $data ), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG ) . "</script>\n";
} );
Notes
Fill in your details and the slug of your About page. Use Organization schema instead if the site represents a company.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.