• Hi all, I have woocommerce installed on a site, as well as the categories taxonomy I also have some custom ones I have assigned to the products custom post type.

    The terms within all of these are actual pages on the site, with descriptions, images and then the related products. I need these term pages to appear in the search results but am struggling to find any posts/topics anywhere where people have done this.

    Everyone seems to want to just return the related posts/products to these terms, but I need the actual term pages to appear in my search results.

    For example one of them is “manufacturers” and each term page contains information on that manufacturer. If someone searches for that manufacturers name I need the term page to appear in the results so they can read up on them…

    If anyone has done this I’d really appreciate some help!

    Cheers 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @epixmedia

    When you say they are “actual pages” on the site, do you mean that you created a Page?

    The WordPress search only searches in the Posts table by default, which means that anything that’s added through Taxonomy Meta isn’t searched.

    Here are some ways to work around this:

    1) Google Custom Search. If you set up a Google Custom Seaach for your site, you’ll be searching all the web pages (including taxonomy archives) that are created. You can create a Google Custom Search for any domain, and then insert it into your site using a bit of JavaScript they give you. You may have to pay to remove the ads that show up at the top of search results. The wordpress.org site uses Google Custom Search, if you want an example.

    2) Make the content describing the taxonomy some kind of post that gets pulled into the taxonomy archive, such that WordPress search finds it. If you are a programmer, this is doable and will teach you a lot about how to customize WordPress.

    There may be some plugins that help with this as well (Relevansi, SearchWP, etc) but I don’t have experience using them.

    Use Relavanssi premium.
    https://www.relevanssi.com/features/

    Moderator bcworkz

    (@bcworkz)

    The classic code-your-own solution to modifying any query, including search queries, is to use the ‘pre_get_posts‘ action. Despite the name, page & CPT (such as ‘product’) queries go through this action as well. On a basic level, you just need to add the ‘page’ post type to the “post_type” query var for any search queries.

    The standard WP search query searches the titles and content of posts for matching terms. Unless your pages contain such terms, even adding ‘page’ to the post_type query var will not get a page found in a search. There are various ways to include keywords in a page such that they are included in a search even if not visible to the user. The best approach depends on how your pages are set up.

    • This reply was modified 7 years, 5 months ago by bcworkz.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show actual taxonomy term pages in search results’ is closed to new replies.