skip to Main Content

WordPress Code Snippets


How to Add Custom Schema Markup to Pages in AIOSEO

Add this PHP snippet to your theme to inject custom schema into a page, enhancing search engine understanding of the page content.

add_filter( 'aioseo_schema_graph', function ( $schemaGraph ) {
    if ( is_page( 'contact' ) ) {
        $schemaGraph[] = [
            '@context' => 'https://schema.org',
            '@type'    => 'ContactPage',
            'name'     => 'Contact Us',
            'url'      => get_permalink()
        ];
    }
    return $schemaGraph;
});

I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

Best WordPress Hosting
Back To Top