Skip to:

Should I still use bp_custom.php in BP 1.1.x?

  • Profile photo of Peterverkooijen


    Should I still use bp_custom.php in BP 1.1.2 and beyond? Or should I put all custom code in functions.php from now on? Is there a difference between the two?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Profile photo of @mercime


    Code in bp-custom.php is applied sitewide unless the function specifically targets certain blog/s much like if a MU-compat plugin is placed in mu-plugins folder. If you put the code in functions.php, , it would only affect only the blog using that specific theme. As of 1.2 bleeding, my bp-custom.php is still working sitewide.

    Profile photo of John James Jacoby
    John James Jacoby


    bp-custom.php loads up before any BuddyPress components do, and functions.php loads after all plugins and WordPress core code does.

    So it isn’t a matter of “if,” it’s a matter of “why.”


    Use bp-custom.php to override core BuddyPress settings like slugs or constant values, or to load specific code BEFORE BuddyPress loads for whatever reason you might need to.

    Use functions.php if you need to add actions or filters to BuddyPress things. It’s good practice to make sure that actions and filters exist before attaching code to them. If you add a filter to a function that doesn’t exist yet, or you add it before/after the code is loaded/executed, then you’re ahead/behind the action/filter curve, so to speak.

    Different files for different purposes.

    Profile photo of Svenl77


    In the codex:

    It says:

    Any custom code that we create can be placed in a file called bp-custom.php. It gets loaded with all the rest of bp automatically by bp during each page load. If you don’t have one already then create one in /wp-content/plugins/. So we’ll pretend that we have done just that and that our three new functions are going to be loaded with the rest of bp.

    but i needed to put the modified buddypress-admin-bar in the functions.php to work.

    Is there any reason?

    Profile photo of Roger Coathup
    Roger Coathup


    @sven. I had this problem in the past, because my mods in bp-custom.php were being overwritten when bp loaded itself.

    The details on how to get them to occur after bp has loaded, are in this thread:

    or, as John points out above, they can go in functions.php which is called afterwards.

    Profile photo of Roger Coathup
    Roger Coathup


    A further thought (comments / corrections appreciated):

    If you make your modifications in bp-custom.php it will affect your entire BuddyPress installation (regardless of which theme you are using)

    If you make your modification in functions.php it will only affect the theme where you have made the changes. i.e. select a different theme and you will lose the changes.

    Profile photo of arnonel


    where do you put bp-custom.php or functions.php?

    everything i try with those gives me a blank page (ie, error)…

    stupid question, but you still have to put <?php and ?> in right?

    Profile photo of Design Cloud
    Design Cloud



    bp-custom.php should go in wp-content/plugins

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Should I still use bp_custom.php in BP 1.1.x?’ is closed to new replies.
Skip to toolbar