• Resolved TomJohnson

    (@tomjohnson)


    I would like to exclude certain pages from being searched. More specifically, I would like to exclude pages from being served up in the Related Entries section of the Related Entries plugin. How do I do that?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Chris_K

    (@handysolo)

    rudolf45

    (@rudolf45)

    If a plugin is showing Pages in posts list… it means it is not compatible with the 2.1.x branch.

    Thread Starter TomJohnson

    (@tomjohnson)

    Thanks HandySolo and rudolf45. I checked the Related Entries plugin and it doesn’t say that it isn’t compatible with 2.1.2.

    How hard is it to tweak the plugin to make it compatible? It seems like a really popular plugin (or one that is at least really useful).

    If I were to insert the <!– google_ad_section_start(weight=ignore) –>

    before and after the pages I want to be ignored in the Related Entries plugin, would that work? Do I have any other options? I really like the plugin.

    Thread Starter TomJohnson

    (@tomjohnson)

    I found this page about 2.1 SQL changes but I have no clue how to implement it.

    Chris_K

    (@handysolo)

    Man, my initial answer was way off. Apologies for that.

    Thread Starter TomJohnson

    (@tomjohnson)

    I was vague with my question. I checked out your site and see that you’re using a Related Posts plugin. I think it’s ultimate tag warrior. Does that work with 2.1.2? Also, do you have to manually enter keywords for that plugin to work, or does it automatically match related posts based on keywords?

    Chris_K

    (@handysolo)

    UTW does the related posts via the tags. And yep, I enter the tags for each article. In general, I find the results to be rather similar to the w-a-s-a-b-i related posts plugin, but since I’m already running UTW…

    I had played around with the wasabi one and 2.1, thought it was working. Let me re-download it and have a quick look at the queries.

    Chris_K

    (@handysolo)

    ok… looking at version 2.0.4, around line 88 we find:

    $sql = "SELECT ID, post_title, post_content,"
             . "MATCH (post_name, post_content) "
             . "AGAINST ('$terms') AS score "
             . "FROM $wpdb->posts WHERE "
             . "MATCH (post_name, post_content) "
             . "AGAINST ('$terms') "
    		 . "AND post_date <= '$now' "
             . "AND (post_status IN ( 'publish',  'static' ) && ID != '$post->ID') ";

    Try changing that to:

    $sql = "SELECT ID, post_title, post_content,"
             . "MATCH (post_name, post_content) "
             . "AGAINST ('$terms') AS score "
             . "FROM $wpdb->posts WHERE "
             . "MATCH (post_name, post_content) "
             . "AGAINST ('$terms') "
    		 . "AND post_date <= '$now' "
             . "AND (post_type = 'post') AND (post_status IN ( 'publish',  'static' ) && ID != '$post->ID') ";

    Thread Starter TomJohnson

    (@tomjohnson)

    Holy Smokes! You totally fixed it. Thank you so much! Now I don’t see any more pages in the Related Links. Again, I really appreciate your help.

    Chris_K

    (@handysolo)

    Rock on – glad it worked! (’cause now is when I confess I hadn’t actually tested it…) 😀

    Thread Starter TomJohnson

    (@tomjohnson)

    I added some info about the contextual related entries plugin here on the comments of my blog (look near the bottom).

    It provides an alternative to the wasabi plugin.

    My post is here.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Exclude pages from being searched’ is closed to new replies.