# Rank Math Breadcrumbs at the Top of Posts and Pages

> Prints the Rank Math breadcrumb trail at the top of single posts and pages, for themes with no built-in breadcrumb area.

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

## Code

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

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

    return rank_math_get_breadcrumbs() . $content;
}, 5 );
```

## Notes

Enable breadcrumbs under Rank Math > General Settings > Breadcrumbs first.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Rank Math Breadcrumbs at the Top of Posts and Pages" 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/
