• [ Moved to the Fixing WordPress sub-forum. ]

    Is there anyway of excluding content form the WordPress search. I know certain posts, pages etc can be excluded but I want a specific text box on each page to be excluded.

    Or if that isn’t possible then the opposite would work too. Specifying that the search only checks a specific part of the content on each post by div class.

    Essentially we want the search result keywords to focus on a specific part of the pages and ignore another part. What would be the best way to achieve this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Doing so would require parsing the content after the database query but before the output which would be extremely inefficient. It would be a better idea to not have whatever section you want to exclude as part of the content and move that to a meta field.

    Thread Starter visualnoise

    (@visualnoise)

    Thanks for your suggestion. I’m not really sure what you’re suggesting or how to go about it.

    Here is the website – http://www.artshow.co.nz/artist-details/aimee-guthrie/

    We have a few hundred artist listings and the user can select a pre-selected search option from a list or enter a keyword. At the moment the search is related to all the text in the custom post type. We don’t the artist description included just the artist name, and the the details about each artwork.

    You may want to consider hiring a developer, this is a fairly complex task you are trying to pull off and the solution depends heavily on how the content is structured.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude a div by class or id from WordPress search’ is closed to new replies.