Alternative option could be using the Rest API:
Example (post):
Search for Jane Doe in posts:
https://example.com/staffsite/wp-json/wp/v2/posts/?search=jane+doe
Example (custom post types):
If the public and searchable custom post type (e.g. staff
) has show_in_rest
set to true
then we can search for Jane Doe in staff posts:
https://example.com/staffsite/wp-json/wp/v2/staff/?search=jane+doe
ps: Somewhat related, if you want to create your own route, using data from multiple sites in the network: WP REST API – Multisite – get posts from all sites
Related Posts:
- Get posts from Network (Multisite)
- Get Recent Posts by Date in Multisite
- switch_to_blog() performance considerations & alternatives
- Merging multiple wp_query objects
- How to get post from all Blog Multisite to the Main Site?
- Get posts from the Main site to sub site – WordPress MultiSites Network
- How can i get the last post from wp multisite?
- Database Queries Optimization with new WP_Query
- WordPress multisite – fallback on subsites to main site on 404 and dealing with switch_to_blog function
- Need Help For WPQuery
- Multisite – Global CPT – advices?
- Multisite wp_query & switch_to_blog issue
- the_post() within switch_to_blog() altering my excerpt
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- Different query result on local and server
- Problem with infinite scroll on multisite with custom query
- meta_query ‘compare’ => ‘IN’ not working
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- WP_Query and next_posts_link
- Sanitation needed for WP_Query or get_posts calls?
- how does $wpdb differ to WP_Query?
- replace the WP_Query class in the main query
- Why is WP-Query spelled like it is?
- Limit search results to exact match
- WP API to fetch all the media/posts records if count is more than 100
- How to use global post counter in the loop?
- WP Meta Query for some meta (array) values
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- WP_Query Filtred by author name ( Return null )
- How to add terms to my tax_query based off of the current post
- Using $paged redirects /page/2 to page 1
- Why wont this wp_query exclude certain pages?
- How do I change database charset when using `wpdb`
- WP_Query attachments by multiple IDs
- get_posts – get all posts by array of author
- wp_query not searching with apostrophe
- pre_get_posts Remove tax_query Completely
- Assigning a meta_query value based on regexp to wp_query fails
- Getting Taxonomy inside WP_Query Loop
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- How to delete taxonomy term when a wordpress user is removed?
- Custom query based on meta key – Reduce three states to two in results?
- How to create a WordPress Post Filter that users can use to filter posts by year?
- WP_Query custom query showing only 10 posts on all pages
- Not getting metavalue
- Ajax load more posts – WP_Query parameters not working
- How to display multiple custom fields with the same meta_key in an ascending order?
- Using the_post_thumbnail resets current loop item ID
- Meta_query with multiple keys and multiple values
- WordPress WP_Query make mysql time out
- Assign Json file to WP_Query
- How do I query for posts by partial meta key?
- WP Query to have sticky posts first, with pagination and having a joint ‘posts per page’ arg with main loop
- New WP_Query calls Pre_get_posts filter twice
- How to increase load time of an archive/search page (WP_Query)
- Switch to blog and get content from that blog
- Removing duplicate values between two wordpress queries
- Issue with front page navigation after upgrading to 3.4
- Ordering posts by an array
- Prevent author bio page from showing in search results
- Changing the default wp_search_stopwords
- WordPress Custom Search Form Displaying Unexpected Results
- WP_Query array key / value pairs?
- Get posts from multiple tax terms
- WP_Query offset is returning post from prevois loop
- Tax query is not working!
- Does WP_Query ‘responds’ badly to empty arguments?
- Does putting queries within loops cause an issue on WordPress?
- Reordering content using a meta value
- Adding query parameter to archive page returns 404
- Optimising WP_Query with ACF Fields
- WordPress AJAX Request returns 400
- Using wpdb prepare with a variable, turns it into a big string
- SQL to join u3g_users & u3g_meta_value with repeating data
- WP_Query no result if keyword contains number
- Order by value of Custom Field using url string
- update_post_meta performance in a loop woocommerce
- Separate by Category Post Type
- ACF: using two loops, the_field returns field content from another loop
- Combine WP_Query with array of custom data to single loop without breaking the pagination
- query_posts() doesn’t seem to be called in my page
- WP_Query with Pagination and orderby meta_value_num showing duplicates
- Optimising specific Query with ACF meta objects
- How to get several fields from wp_query?
- Slow getting posts from category
- Pagination not working with WP_Query (creates links but no page)
- WP Query posts__in not working with array
- query_posts with sorting on a custom datestamp
- Query Posts by date range with fixed beginning and end
- Is it possible to use WP Query to orderby custom meta value and custom taxonomy?
- Display all custom meta field values from the database using ACF Repeater
- How to retrieve _embed (etc) fields in get_posts custom query?
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Get posts using multiple values from ACF checkbox as meta query wordpress
- Display post format post in the sidebar
- How to save the results of a query as a php file for an autocomplete search bar
- Why ignore_sticky_posts argument is in sticky post query?
- WP Query returning all posts when Meta_query is null
- Is there another way to retrieve a post_id from post_meta other than a SQL query?