# Organization Structured Data

> Outputs Organization schema (JSON-LD) on the homepage with your site name, URL, logo and social profiles, helping search engines understand who runs the site.

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

## Code

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

    $data = array(
        '@context' => 'https://schema.org',
        '@type'    => 'Organization',
        'name'     => get_bloginfo( 'name' ),
        'url'      => home_url( '/' ),
    );

    $logo_id = (int) get_theme_mod( 'custom_logo' );
    $logo    = $logo_id ? wp_get_attachment_image_url( $logo_id, 'full' ) : '';

    if ( $logo ) {
        $data['logo'] = $logo;
    }

    // Social profile URLs, for example 'https://www.linkedin.com/company/your-company'.
    $profiles = array();

    if ( $profiles ) {
        $data['sameAs'] = array_values( $profiles );
    }

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

## Notes

Add your social profile URLs to $profiles. Change @type to LocalBusiness or another type if it fits better.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Organization 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/
