Remove sidebar menu items from search results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Remove sidebar menu items from search results

This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11305
    lsumarkb
    lsumarkb
    Participant

    I would like to remove the sidebar menu on our project pages from the search results. I am using the search to display staff members. We also list the staff members from each office in a sidebar menu. Search results are pulling up each staff member because when we search a last name, that last name is listed in the side bar menu. Thanks for the help!

    #11319
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I’ve looked at how the page layout is generated, and I see you are using the Divi page builder to display that sidebar. The problem is, that in this case it becomes the part of the post content, and it’s indexed as well.

    The only solution is to switch back to the regular engine on the <span class=”code”>General Options -> Sources</span> panel: https://i.imgur.com/c9k7j0d.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11320
    lsumarkb
    lsumarkb
    Participant

    Hi Ernest,

    Thanks for your quick reply. If I switch back to the regular engine, can you explain how that would change the search to not include that sidebar?

    #11321
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    You should not notice too many differences (except the irrelevant results disappearing). In your case it will make it more precise.

    When using the regular engine, the shortcodes and filters are not executed and indexed, it simply searches the posts database table as it is. I’m guessing that the Divi builder is using a filter or a shortcode to create a widgetized area, and does not store the actual widget contents in the post content, in the database.

    In other words, the index table engine is used to get the words from the final output (visual output) as it’s represented on the front-end, while the regular engine simply searches the “raw” data within the wordpress posts database table. The raw post content and the visual post content are different – as the visual content is already post-processed. Because the regular engine searches the unfiltered (unprocessed) data, the contents from the widget are not there yet.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11322
    lsumarkb
    lsumarkb
    Participant

    Ok…that worked. Thanks Ernest!! I appreciate how awesome your support is!

    #11323
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Remove sidebar menu items from search results’ is closed to new replies.