Skip to:

How do I edit bbPress breadcrumbs?

  • What I want to achieve:

    I’ve installed bbPress as a plugin for WordPress. I want to make a few simple changes to the bbPress bread crumb function:


    I need the bread crumb separator to be double right arrows rather than the default single arrow:

    I want to replace > with ».

    I also want to add “You are here:”

    Why I need this:

    I need to match the styling and position the Yoast Breadcrumbs. Yoast Breadcrumbs is installed as a plugin for WordPress. It breaks on bbPress pages.

    What I’ve tried:

    Using conditions and CSS, I disabled the Yoast bread crumbs on bbPress pages. I also disabled the default bbPress bread crumbs but called it just beneath my primary navigation. Effectively, I’ve “moved” the bbPress bread crumbs.

    To change the bread crumb separator I’ve researched JavaScript and jQuery string replacements but I’ve been advised that this is “hacky”.

    My question:

    What’s the conventional way of changing the output of bbPress function?

    I can provide additional JavaScript, PHP and CSS code if required.

    Live demo:

    These two live examples highlights the two types of bread crumbs:

    Yoast bread crumbs:

    bbPress bread crumbs:

Viewing 21 replies - 1 through 21 (of 21 total)
  • I have come across an example of a filter to change the bread crumb separators but I can’t seem to get it to work:

    add_filter( 'breadcrumb_trail_args', 'my_breadcrumb_trail_args' );

    function my_breadcrumb_trail_args( $args ) {

    $args = ‘ → ‘;

    return $args;



    I’ve found a list of hooks and filters for bbPress at:


    I’ve also found the bbPress bread crumb function(s) at:


    By combining code from the two, I’ve attempted adding a filter but it’s being ignored:

    function test_args($args) {

    $args = array(

    'sep' => ' x ',


    return $args;



    In bbp-common-template.php I found:

    // Allow the separator of the breadcrumb to be easily changed

    $sep = apply_filters( 'bbp_breadcrumb_separator', $sep );

    I attempted to apply a filter…

    $sep = 'x';

    add_filter('bbp_breadcrumb_separator', $sep);

    …but it resulted in:

    Warning: call_user_func_array() []: First argument is expected to be a valid callback, 'x' was given in

    I’ve figured out how to change the bread crumb separator:

    <br /><br />
    // Change bbPress bread crumb separator.
    function filter_bbPress_breadcrumb_separator() {
    //$sep = ' &raquo; ';
    $sep = is_rtl() ? __( ' &laquo; ', 'bbpress' ) : __( ' &raquo; ', 'bbpress' );
    return $sep;
    add_filter('bbp_breadcrumb_separator', 'filter_bbPress_breadcrumb_separator');

    I have not yet figured out how to add “You are here: ” at the start of the bread crumbs:

    I’ve tried this…

    <br /><br />
    function my_breadcrumb_trail_args( $trail ) {<br /><br />
    $args = '<div class="bbp-breadcrumb"><p>You are here: ';<br /><br />
    return $args;<br /><br />
    };<br /><br />
    add_filter( 'breadcrumb_trail_args', 'my_breadcrumb_trail_args' );<br /><br />

    …and this…

    <br /><br />
    function test($defaults) {<br /><br />
    $defaults = array(<br /><br />
    'before' => '<div class="bbp-breadcrumb"><p>You are here: ',<br /><br />
    );<br /><br />
    return $defaults;<br /><br />
    }<br /><br />
    add_filter('bbp_breadcrumb','test_args');<br /><br />

    Neither work.

    For now I’ve taken the hacky approach and just edited my bbPress files directly. You can see it in action here:

    Any assistance with the filter would be greatly appreciated.

    I made a filter that set’s the before, after, sep & root_text for the breadcrumbs. Take a look, writes over the ‘bbp_get_breadcrumb_pre’ filter found on line 1553 of bbp-includes/bbp-common-template.php

    // Change bbPress bread crumb separator.
    function filter_bbp_breadcrumb( $args ) {

    $my_args = array(
    'before' => "n<div class="subnav bbp-breadcrumb ">n <ul class="nav nav-pills ">n <li>",
    'after' => "</li>n </ul>n</div>nn",
    'sep' => is_rtl() ? __( "</li>n <li>", 'bbpress' ) : __( "</li>n <li>", 'bbpress' ),
    'root_text' => "Support"

    $args = wp_parse_args( $my_args, $args );
    return $args;

    add_filter('bbp_get_breadcrumb_pre', 'filter_bbp_breadcrumb' );

    Yep thats correct. You can pick and choose the args if you don’t want to reset all of them.

    function custom_forum_breadcrumb( $args ) {

    $args['sep'] = ' | ';

    return $args;

    add_filter( 'bbp_get_breadcrumb_pre', 'custom_forum_breadcrumb' );



    Thanks mattsimo and jaredatch. Worked the charm.

    Here are all of the $args and the defaults, FYI (pulled from bbPress core file: bbp-common-template.php)

    // HTML
    'before' => '<div class="bbp-breadcrumb"><p>',
    'after' => '</p></div>',
    'sep' => is_rtl() ? __( '&lsaquo;', 'bbpress' ) : __( '&rsaquo;', 'bbpress' ),
    'pad_sep' => 1,

    // Home
    'include_home' => $pre_include_home,
    'home_text' => $pre_front_text,

    // Forum root
    'include_root' => $pre_include_root,
    'root_text' => $pre_root_text,

    // Current
    'include_current' => $pre_include_current,
    'current_text' => $pre_current_text



    Hi everyone…

    since BBPress 2.1 has removed bbp_get_breadcrumb_pre filter, can anyone provide a quick solution to get the same result as above?




    Ok, at the moment I tested this

    function custom_bbp_breadcrumb($r) {
    $r = ' | ';
    return $r;
    add_filter('bbp_before_get_breadcrumb_parse_args', 'custom_bbp_breadcrumb' );

    and it seems to work, but maybe there is a more elegant solution… any help is appreciated :-)



    Where does one install filters in 2.1?



    Because bbPress is just a plugin you should be able to put filters into your functions.php file of your wordpress theme.



    So, using the code example several posts above, from manuelmasia — let’s say that I wrap that in php tags and drop it into a functions.php file in my child theme directory. Is there anything else that I would need to do in order to get the breadcrumbs to display differently?

    • This reply was modified 10 years, 1 month ago by Clay.



    It should work, I am not sure if you will need to wrap it in php tags though?
    I don’t need to in my functions file.



    By the way this code snippet works for me:

    function custom_bbp_breadcrumb() {
        $args['sep'] = ' | ';
        return $args;
    add_filter('bbp_before_get_breadcrumb_parse_args', 'custom_bbp_breadcrumb' );
    • This reply was modified 10 years, 1 month ago by Lynq.



    Open bbp-common-template.php from bbp-include

    // Wrap the separator in a span before padding and filter if ( !empty( $sep ) )

    and edit

    $sep = '' . ' EDIT HERE ' . '';

    You can change it into any text or image w/ codes.

    • This reply was modified 9 years, 11 months ago by Clementtang.
    • This reply was modified 9 years, 11 months ago by Clementtang.

    John James Jacoby


    Don’t modify bbPress core. Use the filters instead.

    David Decker


    I’ve released a small bbPress Plugin called “String Swap” where you can easily change a few breadcrumb parameters as well as some other strings for the frontend.

    You can check it out here:

    After installing/activating, look on the bbPress Settings page where there is a new section then 🙂

    Hope this helps some users 🙂




    Please do the people on a huge favor and delete all the fancy stuff in this comment-form, just load the default wordpress.ORG comment-form it’s huge and only support a few needed options. This is getting ridicules. People have to be an acrobat to post some code on this forums.

    I can’t copy-/paste @mattsimo code because of this forum-software.

    Safari + Firefox it doesn’t copy the the selected code i needed.



    updated list as of 2.2:


    $defaults = array(


    // HTML

    ‘before’          => ‘<div class=”bbp-breadcrumb”><p>’,

    ‘after’           => ‘</p></div>’,


    // Separator

    ‘sep’             => __( ‘&rsaquo;’, ‘bbpress’ ),

    ‘pad_sep’         => 1,

    ‘sep_before’      => ‘<span class=”bbp-breadcrumb-sep”>’,

    ‘sep_after’       => ‘</span>’,


    // Crumbs

    ‘crumb_before’    => ”,

    ‘crumb_after’     => ”,


    // Home

    ‘include_home’    => $pre_include_home,

    ‘home_text’       => $pre_front_text,


    // Forum root

    ‘include_root’    => $pre_include_root,

    ‘root_text’       => $pre_root_text,


    // Current

    ‘include_current’ => $pre_include_current,

    ‘current_text’    => $pre_current_text,

    ‘current_before’  => ‘<span class=”bbp-breadcrumb-current”>’,

    ‘current_after’   => ‘</span>’,


    pulled from bbpress/includes/common/template-tags.php


    setup your args and pass them to the bbp_breadcrumb function 



    How do you change just the defaults in this new version? Every time I try, the only output is “Array”. I don’t want to filter the whole function, just the

    ‘before’ => ”,
    ‘after’ => ”,



    Nevermind, Lynq’s solution worked the 2nd time I tried it.

Viewing 21 replies - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.
Skip to toolbar