Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Buddypress Breaks WordPress Search

  • Profile photo of digitalchild
    digitalchild
    Participant

    @digitalchild

    Hello,

    I have a wp 3.9.1 site that I’ve just installed buddypress 2.0.1 on and when I enable the plugin all wordpress search stops working. Any search term just redirects back to the home page of the site.

    I am also using a search plugin facetious search which also redirects back to the home page.

    Search only stops working when I enable buddypress.

    Anywhere I can look to debug this issue?

    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Profile photo of Roquefort
    Roquefort
    Participant

    @roquefort

    I am experiencing the similar issues. BuddyPress by default “hijacks” the WordPress search, and searches seem to only be applied against my BP pages – which are few. I need my WordPress search back.

    If there isn’t a way to include both (and given my Google searches, there doesn’t seem to be,) is there a way to disable BuddyPress search completely?

    Profile photo of digitalchild
    digitalchild
    Participant

    @digitalchild

    Hi Roquefort.

    After I posted this I investigated the source code and came to the same conclusion as you. BuddyPress does take over WordPress search and causes any other WordPress search (including the inbuilt one) to stop working.

    I did however find a work around! What happens is buddypress defines a search slug that is the same as WordPress. What you have to do is redefine the buddypress search slug to something else and your search will start working again.

    Basically you want to put the following in your wp-config.php

    `define( ‘BP_SEARCH_SLUG’, ‘bpsearch’ );

    I tried to load this further up the stack to try and override this but wp-config seemed to be the only place this worked.

    You can find out more about how I worked this out over at this post:

    https://digitalchild.info/buddypress-wordpress-search/

    Profile photo of Henry Wright
    Henry Wright
    Moderator

    @henrywright

    Hi @digitalchild

    I just read your blog post. It’s interesting you couldn’t get define( 'BP_SEARCH_SLUG', 'searchresults' ); to work outside of wp-config.php. Have you tried creating a bp-custom.php file and popping the constant definition in there?

    Ref: https://codex.buddypress.org/plugindev/bp-custom-php/

    Profile photo of Roquefort
    Roquefort
    Participant

    @roquefort

    Thanks for the quick response guys! I followed @digitalchild ‘s instructions, and search now does what I want it to!

    Profile photo of digitalchild
    digitalchild
    Participant

    @digitalchild

    Hi @henrywright

    It appears bp-custom does work now! I must have been doing something wrong. I’ve put it in the top of my existing bp-custom.php and its working. I prefer putting this here. Thanks for the tip.

    I’ll update my blog post to note this.

    @roquefort Check my blog post in a few minutes this will reflect a better way to do this.

    thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Buddypress Breaks WordPress Search’ is closed to new replies.
Skip to toolbar