Title: Multisite Search?
Last modified: August 20, 2016

---

# Multisite Search?

 *  Resolved [Noel Forte](https://wordpress.org/support/users/fortissimo95/)
 * (@fortissimo95)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/)
 * If I wanted to do a multi-site search, is there any possible way to do something
   like this?

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005767)
 * I’ve not tried it myself but this was the first hit in my Google search.
 * [http://wordpress.org/extend/plugins/multisite-global-search/](http://wordpress.org/extend/plugins/multisite-global-search/)
 * Apparently there are others as well.
 * [http://wordpress.org/extend/plugins/search.php?q=multisite+search](http://wordpress.org/extend/plugins/search.php?q=multisite+search)
 *  Thread Starter [Noel Forte](https://wordpress.org/support/users/fortissimo95/)
 * (@fortissimo95)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005802)
 * Alright, I’ve gone through everything in google and the plugin respiratory. Thank
   you kindly for the suggestions.
 * Any other ideas?
 *  [Roy](https://wordpress.org/support/users/gangleri/)
 * (@gangleri)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005808)
 * I tried that first plugin a year ago, but [couldn’t get it working](http://wordpress.org/support/topic/plugin-multisite-global-search-create-view-privileges?replies=13).
   I might need to try again, but first check what MySQL is installed on my server.
 * Back then I tried a few others without succes and ended up using Google which
   I am relatively happy with. See Gangleri.nl and the ‘search entire website’ option
   in any of the subsites (books, films, music, )
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005834)
 * Noel – What errors did you have? 🙂 Or what didn’t work the way you wanted and
   how?
 * Knowing where it didn’t meet the mark helps us adjust aim 😉
 *  [Roy](https://wordpress.org/support/users/gangleri/)
 * (@gangleri)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005835)
 * Mika, I don’t think that Noel already tried the plugin, she was out for a multisite
   search option. Back in the days (…) _I_ couldn’t get it working, but I haven’t
   tried it since.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005836)
 * Noel said he(?) went through everything in Google. So … what didn’t meet the 
   criteria? 🙂 I mean, if you go through everything you find and nothing meets 
   the need, what need is it missing…
 * It’s a bold assumption. (You I know, couldn’t get it working, but if you still
   need help, make a new topic for that 😉 Which you know.)
 *  [Roy](https://wordpress.org/support/users/gangleri/)
 * (@gangleri)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005837)
 * Ah no, I’m fine thank you 🙂
    Let’s see if Noel still needs help indeed.
 *  Thread Starter [Noel Forte](https://wordpress.org/support/users/fortissimo95/)
 * (@fortissimo95)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005851)
 * Yes I’m a guy , and i was considering perhaps using google custom search to deliver
   results. What I’m basically looking for is a way to search over multiple blogs
   an display the results on a seperate page.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005866)
 * [http://wordpress.org/extend/plugins/multisite-global-search/](http://wordpress.org/extend/plugins/multisite-global-search/)
   should do that. I tested and it seems to work just fine.
 *  [Roy](https://wordpress.org/support/users/gangleri/)
 * (@gangleri)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005875)
 * Sorry Noel, I didn’t pay enough attention…
    Anyway, you’ve got several hints 
   above, the plugin that is mentioned a few times and that seems to work well (
   I’ll have to try it again myself some time). Google search is an option. See 
   Google for more info. [http://www.google.com/cse](http://www.google.com/cse)
 * Try both and let us know when something goes different than expected.
 *  Thread Starter [Noel Forte](https://wordpress.org/support/users/fortissimo95/)
 * (@fortissimo95)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005888)
 * OK, so I’ve got the multisite plugin working. Unfortunately, when I implement
   the code onto my page, the browser returns the following errors.
 * Implemented this:
    `<?php Multisite_Global_Search::ms_global_search_horizontal_form('
   search-results') ?>`
 * Returned this:
 *     ```
       Warning: Missing argument 2 for Multisite_Global_Search::ms_global_search_vertical_form(), called in /home/noelfo5/public_html/wp-content/themes/fortissimo/homepage.php on line 40 and defined in /home/noelfo5/public_html/wp-content/plugins/multisite-global-search/inc/class.widgets.php on line 109
   
       Warning: Missing argument 3 for Multisite_Global_Search::ms_global_search_vertical_form(), called in /home/noelfo5/public_html/wp-content/themes/fortissimo/homepage.php on line 40 and defined in /home/noelfo5/public_html/wp-content/plugins/multisite-global-search/inc/class.widgets.php on line 109
       ```
   
 *  Thread Starter [Noel Forte](https://wordpress.org/support/users/fortissimo95/)
 * (@fortissimo95)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005892)
 * Fixed it. Thanks for all your help.
 *  [jnwb](https://wordpress.org/support/users/jnwb/)
 * (@jnwb)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005943)
 * Hi Noel – I’m getting the same two error messages as you with the multisite search
   plugin. Do you remember how you fixed it?
 * Thanks
 *  Thread Starter [Noel Forte](https://wordpress.org/support/users/fortissimo95/)
 * (@fortissimo95)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005945)
 * Hi jnwb,
 * Here’s the fix: (and an explanation)
 * In this case, the solution is actually in the error message. If we open up our
   file “class.widgets.php” which you can find by going toi the path dictated in
   the warning, we see the following on lines 109-137.
 *     ```
       function ms_global_search_vertical_form( $page, $search_pages, $hide_options ) {
       		if( isset( $this ) ) {
       		    $id_base = $this->id_base;
       		} else {
       		    $id_base = 'ms-global-search';
       		}
   
       		$rand = rand(); $rand2 = $rand + 1; ?>
       		<form class="ms-global-search_form" method="get" action="<?php echo get_bloginfo( 'wpurl' ).'/'.$page.'/'; ?>">
                   <input id="s" class="field" name="mssearch" type="text" placeholder="Search across network sites:" size="16" tabindex="1" />
                   <input type="submit" id="searchsubmit" class="button submit" value="<?php _e( 'Search', 'ms-global-search' )?>" tabindex="2" />
       	    </form>
       	<?php
       	}
   
       	function ms_global_search_horizontal_form( $page, $search_pages, $hide_options ) {
       		if( isset( $this ) ) {
       		    $id_base = $this->id_base;
       		} else {
       		    $id_base = 'ms-global-search';
       		}
   
       		$rand = rand(); ?>
       	    <form class="ms-global-search_form" method="get" action="<?php echo get_bloginfo( 'wpurl' ).'/'.$page.'/'; ?>">
                   <input id="s" class="field" name="mssearch" type="text" placeholder="Search across network sites:" size="16" tabindex="1" />
                   <input type="submit" id="searchsubmit" class="button submit" value="<?php _e( 'Search', 'ms-global-search' )?>" tabindex="2" />
       	    </form>
       	<?php
       	}
       ```
   
 * The above code might look a bit different than your own; I hacked the plugin 
   and inserted the WordPress search form as the return for the search form instead
   of the multisite one, this way it styles the same in your CSS as it was intended
   in your theme.
 * These two functions are what control the php code that you called. ( `<?php Multisite_Global_Search::
   ms_global_search_horizontal_form('search-results') ?>` However, when you compare
   your php to the function that the php is calling, you might notice something 
   odd.
 * Remember, this is what you put in:
 *     ```
       <?php Multisite_Global_Search::ms_global_search_horizontal_form('search-results') ?>
       ```
   
 * and the function looks like this:
 *     ```
       function ms_global_search_vertical_form( $page, $search_pages, $hide_options )
       ```
   
 * So what we have here is a line of PHP code that calls a function which demands
   $page, $search_pages, and $hide_options as input arguments, but in our code, 
   we only provided one, “search-results” as our $page, hence the _“missing argument
   on line 109”_.
 * So to fix this, let’s provide the function in the “class.widgets.php” file with
   two additional arguments, whether we want to search pages, and whether we want
   to show the options.
 * My final markup looked like this:
 *     ```
       <?php Multisite_Global_Search::ms_global_search_vertical_form('search-results','','hide_options'); ?>
       ```
   
 * Notice I left the $search_pages option blank. You can do this, and the plugin
   will default to a value of 0, and not search pages. If you would like to include
   pages in your search, set it to 1.
 * Kinda a long way around just for one line of code, but I hope the explanation
   was useful. If you have more questions, don’t hesitate to ask.
 * PS. I didn’t like how this plugin worked, there were a few quirks to get by. 
   If you dig through the plugin files, you could figure out what everything does
   and hack it to your liking. After all that’s the purpose of plugins, right? Open
   source for the win.
 * Hope this helped,
 * Noel
 *  [jnwb](https://wordpress.org/support/users/jnwb/)
 * (@jnwb)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005946)
 * Thanks so much Noel – that’s extremely helpful!

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Multisite Search?’ is closed to new replies.

## Tags

 * [blogs](https://wordpress.org/support/topic-tag/blogs/)
 * [find](https://wordpress.org/support/topic-tag/find/)
 * [index](https://wordpress.org/support/topic-tag/index/)
 * [multi-site](https://wordpress.org/support/topic-tag/multi-site/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 15 replies
 * 5 participants
 * Last reply from: [jnwb](https://wordpress.org/support/users/jnwb/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/multisite-search-2/#post-3005946)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
