Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jonas Grumby

    (@ss_minnow)

    p.s. I tried Simply Exclude but I get this message when trying to save any settings:

    You do not have sufficient permissions to access this page.

    Put this within your search form field:

    <form…..>
    <input type=”hidden” name=”cat” value=”-your default category ID” />
    </form>

    Your pages are assigned your default category ID so using the minus will remove all pages from your results.

    this fix didnt work for me, below is the code I used. it broke my search to display no results for any query.

    <form method=”get” id=”searchform” action=”<?php bloginfo(‘url’); ?>/”>
    <div id=”search”>
    <input type=”text” value=”Search Here” name=”s” id=”s” class=”field” style=”width:95px; height:17px; background:#efefef ; font-weight:bold; color:#003366 ;” />
    <input type=”hidden” name=”cat” value=”1″ />
    <input type=”image” src=”<?php bloginfo(‘template_url’); ?>/images/loupe.gif” style=”width:10px;height:12px;”/>
    </div>
    </form>

    you’ve got it slightly wrong – you have to include a minus symbol (-) before the cat ID to tell it to exclude it.

    here is my form (without the styling):

    <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
    <input type="hidden" name="cat" value="-1" />
    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s">
    <input class="searchbutton" type="submit" id="searchsubmit" value="SEARCH">
    </td></tr></table></form>
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Exclude pages from search results?’ is closed to new replies.