# Set About and Contact Page Types in Yoast Schema

> Changes the WebPage type in the Yoast SEO graph to AboutPage, ContactPage or another type for the page slugs you choose.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: yoast, schema, pages
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/yoast-webpage-type-per-page/

## Code

```php
// Page slug => schema.org WebPage type.
$wpide_page_types = array(
    'about'   => 'AboutPage',
    'contact' => 'ContactPage',
);

add_filter( 'wpseo_schema_webpage_type', function ( $type ) use ( $wpide_page_types ) {
    if ( ! is_page() ) {
        return $type;
    }

    $slug = get_post_field( 'post_name', get_queried_object_id() );

    if ( isset( $wpide_page_types[ $slug ] ) ) {
        // Keep WebPage alongside the subtype so Yoast's other pieces still match.
        return array( 'WebPage', $wpide_page_types[ $slug ] );
    }

    return $type;
} );
```

## Notes

Map your own page slugs to schema.org WebPage subtypes such as FAQPage, CollectionPage or CheckoutPage.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Set About and Contact Page Types in Yoast Schema" 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/
