• Resolved Chris Briley

    (@chris-briley)


    Hello,

    When I do a search, the homepage comes up in the results showing shortcode from visual composer in the excerpt. I added a function to remove the VC shortcode from other excerpts, but it doesn’t work on the homepage result. I need help removing the shortcode from the result or removing the homepage from the search results. I’ve tried using plugins like Search Exclude, but they don’t work with Better Search. Any help is greatly appreciated!!!

    Thank you!
    Chris

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ajay

    (@ajay)

    You don’t have a quick way to exclude these currently. However, you can add custom code into your theme’s functions.php to filter bsearch_posts_where to add

    $where .= " AND $wpdb->posts.ID NOT IN ('1,2,3') "
    
    Thread Starter Chris Briley

    (@chris-briley)

    Hi Ajay!

    Thanks for your reply. I have a child theme functions file to add the code to, but I’m not exactly sure how to add this. Can you please show me all of the code I need to add? When I add the line above with my ID the site goes white.

    Thank you!
    Chris

    Thread Starter Chris Briley

    (@chris-briley)

    Hi Ajay,

    I just added a function to allow my pages to have a custom excerpt, allowing me to change the excerpt to not show the shortcode.

    Thank you!
    Chris

    Plugin Author Ajay

    (@ajay)

    Thanks for the update. I will be adding the exclusion settings in a future version of this plugin

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove a specific page from search results’ is closed to new replies.