# Author Profile Structured Data

> Adds ProfilePage JSON-LD to author archives, describing the author as a person with their name, bio, avatar and website.

- Type: PHP
- Runs: Frontend only
- Category: [SEO](https://wpide.com/library/category/seo/)
- Tags: schema, authors, json-ld
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/profile-page-schema-for-authors/

## Code

```php
add_action( 'wp_head', function () {
    if ( ! is_author() ) {
        return;
    }

    $author = get_queried_object();

    if ( ! $author instanceof WP_User ) {
        return;
    }

    $person = array(
        '@type' => 'Person',
        'name'  => $author->display_name,
        'url'   => get_author_posts_url( $author->ID ),
        'image' => get_avatar_url( $author->ID, array( 'size' => 256 ) ),
    );

    if ( $author->description ) {
        $person['description'] = wp_strip_all_tags( $author->description );
    }

    if ( $author->user_url ) {
        $person['sameAs'] = array( $author->user_url );
    }

    $data = array(
        '@context'   => 'https://schema.org',
        '@type'      => 'ProfilePage',
        'mainEntity' => $person,
    );

    echo '<script type="application/ld+json">' . wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG ) . "</script>\n";
} );
```

## Notes

Author archives must be enabled for this to have any effect.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Author Profile Structured Data" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
