# Show Yoast Breadcrumbs Above Post Content

> Prints the Yoast SEO breadcrumb trail at the top of posts and pages for themes that have no breadcrumb spot of their own.

- Type: PHP
- Runs: Frontend only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: yoast, breadcrumbs, content
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/yoast-breadcrumbs-above-content/

## Code

```php
// Post types that get the breadcrumbs.
$wpide_crumb_types = array( 'post', 'page' );

add_filter( 'the_content', function ( $content ) use ( $wpide_crumb_types ) {
    if ( ! function_exists( 'yoast_breadcrumb' ) || is_front_page() || ! is_singular( $wpide_crumb_types ) || ! in_the_loop() || ! is_main_query() ) {
        return $content;
    }

    $trail = yoast_breadcrumb( '<div class="wpide-breadcrumbs">', '</div>', false );

    return $trail ? $trail . $content : $content;
}, 5 );
```

## Notes

Turn on breadcrumbs under Yoast SEO > Settings > Advanced > Breadcrumbs. Skip this snippet if your theme already shows them.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Show Yoast Breadcrumbs Above Post Content" 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/
