It turns out the free Relevanssi plugin does this rather well. I was afraid it would only search posts and not custom post types, but it does it all… and rather well! It only requires a simple filter added to your theme’s functions.php
file to get it to omit the body content:
// search titles only (relevanssi plugin)
add_filter('relevanssi_index_content', 'contentoff');
function contentoff() {
return false;
}
alternatively you can have it omit titles (don’t use the two together or you’ll be searching nothing!
// search titles only (relevanssi plugin)
add_filter('relevanssi_index_titles', 'contentoff');
function contentoff() {
return false;
}
Related Posts:
- Adding a second email address to a completed order in WooCommerce [closed]
- How to redirect to post if search results only returns one post
- Possible to search by author name with default WordPress search function?
- paginate_links() don’t properly work in search.php?
- Filter the query ONLY for the search results page
- Extending the site search to include a single custom field
- Modify search function in WordPress (TwentyTwelve)
- How to customize search result page title?
- Display WordPress Search
- Search user metadata with checkboxes via ajax (almost working)
- Searching for content post
- Custom Taxonomy Tag Search
- Woocommerce Attributes pulling in wrong data
- WooCommerce product search titles only
- Is there a way I can find wordpress posts that don’t contain a word?
- changing behaviour of get_search_form
- woocommerce: change default setting > is_sold_individualy function
- WooCommerce – Want to show multiple currency for a single product [closed]
- Search filter by Post title OR Meta Title Value [duplicate]
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- paginate_links() don’t properly work in search.php?
- Include the post type before the title of search results
- How to rewrite wordpress search to work on specific category
- two search forms on the same page
- search form leads to 404
- Custom function for search form
- WordPress: Highlight search result exact matches
- RSS feeds for specific topics
- Search in WordPress
- Limiting WordPress Search function : Custom build
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- More than one search results page template for two searches on site
- How do i create a search option for pdf’s only
- Form output outside of container
- Limit Number of Posts on Blog Category Page Throwing 404 Error on Paginated Pages
- us states dropdown function and echo in theme template files
- Pagination in Search result
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- child_of not working while searching
- wordpress Search function is not working
- Custom Post Type Search
- How to export comments in WordPress?
- How to change the markup WordPress inserts for post images
- When tax_query used, results disappear (0 =1 produced)
- wp_get_attachment_image returns different image size
- Limit the length of the Author Profile Biographical Text
- wp_mail not running inside Cron
- Remove product description from product archive page
- Logging in redirects to correct page but shows logged out content until forced refresh
- What is the criteria for pluggable functions?
- How can I stop a function from encoding an entity?
- Theme-Config tab in admin Pannel?
- Change woocommerce products weight varation based its product category or tags? [closed]
- Function to “Press Update Button” on all posts
- Change WP attachment name to postid during upload only for post type
- Missing argument 2 for a custom function widgets_init
- Debugging Technique Question re: functions.php
- How to target only the front page (not subsequent paginated pages) in theme/plugin?
- Defining a global array in functions.php?
- Get the 5 lastest Featured Posts from a category
- get_post_type() in in_array doesn’t work for some reason
- Is it possible to change any of the HTML/URL returned from the_category()
- How to remove set_post_thumbnail_size() in child themes?
- Activate small php condition at footer over page template
- How to insert custom widget in custom sidebar in theme activation?
- how to en-queue jQuery to load before the tag
- Impossible to call wordpress function inside an include?
- Remove a category from a post when saving a new post
- Want to dequeue all the CSS and JS from /wp-content/uploads/xyz-folder
- Scripts not loading when using the wp_enqueue_scripts action
- add referrer to woo
- overwrite code snippet from parent to child theme
- If no author posts, echo out some text
- How to make WooCommerce payment method field optional?
- Gravity Forms – Custom Merge Tag Convert date_created to Local/WordPress Time?
- WordPress Custom Hook with Class method
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- Remove check boxes and its label from screen option for custom role
- Removing comment lines from all enqueued js files using a filter function
- Auto copy value from specific user meta field to another field
- Variable function names
- Route wordpress with template
- How to Call Function From Separate WordPress Install on Same Server?
- Function causes edit_post_link to link to the wrong post
- How to echo a plugin’s function into a template?
- Getting back a blank WordPress site following functions code edit
- Insert menu into theme location depending on user logged in/out status
- Add functionality to post editor
- Define an extra field for all pages (with no plugin?)
- Wp Ecommerce Reposition Product Page Product Thumbnail Image
- It possible to implement an adhoc php web application with wordpress?
- How to Overwrite validate_plugin function
- Set thumbnail from URL, by grabbing image in functions.php
- admin-ajax.php nulls all php variables
- Disable plugin function
- WP Custom Comment Callback Not Responding
- Shortcodes not outputting in correct divs
- Help finishing script to export WP user data when form submitted
- How I can show short content with short tag
- WordPress enque the same script causes the setInterval not to work