[Plugin: Search Everything] can this exclude attachments from search? (3 posts)

  1. Steve
    Posted 5 years ago #

    I'm looking for a way of excluding all attachments (files, images) from search results. Looking at this plugin I have a couple of questions

    Looking at the options page I'm unclear about

    1. Is the default setting for all of the options No? The choices I see are blank or Yes
    2. Can use this plugin to make all searches exclude all attachments? I see I can choose yes to 'search every attachment' but is there a no, don't search any attachments?
    3. Ta.


  2. fmachs
    Posted 5 years ago #

    I am looking for a way to exclude attachments from the metadata search.
    Any ideas?

  3. fmachs
    Posted 5 years ago #


    Found line 520:
    $search = " OR ({$search}) ";

    And changed to:
    $search = " OR ({$search}) AND $wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'attachment' ";

    That solved my problem. Now the search works for custom fields and isn't duplicating entries.

Topic Closed

This topic has been closed to new replies.

About this Topic