Viewing 8 replies - 1 through 8 (of 8 total)
  • You enter the page ID’s into the “Exclude pages” section and it will work

    Hey @davamb, thanks for reaching out and sorry for not replying any sooner but I see that @genovic has you covered – so, big thank you @genovic for the solution, truly appreciate it!

    All the best to both of you,
    Petra

    Thread Starter davamb

    (@davamb)

    Thanks genovic and Petra – the problem with this (for us) is that we would have to remember to add the page ID of every new page we add. It seems that having the option of excluding ALL pages globally would be more useful.

    In our case, we only want to search posts, not pages.

    Thanks,
    David

    Hey David,

    you can try this: go to “Plugins”-> “Editor” and in the search-everything.php file find the “function se_search_default()” function.
    Modify search_sql_query like so:

    $search_sql_query .= ") AND $wpdb->posts.post_type <> 'page' ";

    Don’t forget to click “Update File” after the change.

    Let me know how it goes, take care and have a lovely weekend,
    Petra

    Thread Starter davamb

    (@davamb)

    Hey Petra,

    Sorry it took me a few days to test this.

    “search_sql_query” exists several times in the function. Which one should be changed?

    It seems to me that the third and final instance is the one you say I should change – but it doesn’t stop pages coming up in the results.

    I replaced:
    $search_sql_query .= ')';
    with:
    $search_sql_query .= ") AND $wpdb->posts.post_type <> 'page' ";

    Did I change the wrong line, or could it be something else?

    Thanks,
    David

    Hmm…this is strange, it should work – could it be you have a custom theme? Which theme do you use?

    Looking forward to your reply,
    Petra

    Thread Starter davamb

    (@davamb)

    We’re using Builder, by iThemes. It’s highly customized and includes a number of custom templates too.

    These template pages are coming up in the results (with only the placeholder text) which is one of the reasons we want to prevent pages coming up in the search results…but regular WP pages are coming up too.

    Does this mean your plugin won’t work for us?

    Thank you for taking the time on this.
    Best wishes,
    David

    Hey David,

    that is most likely the problem. And because those are not free to use themes I can’t test anything on my side, sorry.

    Take care and have a nice weekend,
    Petra

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Search Everything: How to exclude all pages in results’ is closed to new replies.