WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Relevanssi Search - Exclude the Single Post Type While Including its Taxonomy (5 posts)

  1. inhouse
    Member
    Posted 6 months ago #

    Hello, I'm trying to exclude single FoxyShop products post type from search while including the taxonomies/categories of the same post type. Currently I can exclude the post type but I cannot get the taxonomies to be found. I am using a custom field from ACF for the taxonomy and they are not being indexed/searched. Details are below. If anyone can help with this, I'd greatly appreciate it.

    Post Type: foxyshop_product
    Taxonomy: foxyshop_categories
    Exclude from Search: foxyshop_products
    Include in Search: category_description custom field for foxyshop_categories taxonomy

    http://wordpress.org/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 6 months ago #

    Basic Relevanssi doesn't find taxonomy terms; you need Relevanssi Premium for that.

    I'm not sure what the custom fields have to do with this, but custom fields are related to posts, and if you're blocking the posts from the search, you won't find anything with the custom fields - as they would return the post the custom field is related to.

  3. inhouse
    Member
    Posted 6 months ago #

    Ok, let's say I purchase the premium plugin. Is there a way to hide the single post types from displaying in search results while still indexing the taxonomies? Or am I better off with some kind of redirect that redirects from a single post type to the parent category?

  4. inhouse
    Member
    Posted 6 months ago #

    Ah, I found a workaround to this. I added a class to my search results container for the single post type results. This allows me to hide them from view so the visitor doesn't ever see the single post types but they can find the post categories once we buy Relevanssi Premium. Should happen early next week. Thanks for your help.

  5. Mikko Saari
    Member
    Plugin Author

    Posted 6 months ago #

    Also, you can use relevanssi_hits_filter to process the search results and remove anything you don't want to appear in the results.

Reply

You must log in to post.

About this Plugin

About this Topic