Wordpress - show POSTS only (not PAGES) in search results?

Discussion in 'WordPress' started by Kerosene, Dec 19, 2008.

  1. #1
    I only want my posts to show when somebody does a search on my WP sites.
    Anyone know how to stop pages showing up in the search results?
     
    Kerosene, Dec 19, 2008 IP
  2. acakadut

    acakadut Peon

    Messages:
    194
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    cmiiw, isn't that the way wp search work?
     
    acakadut, Dec 19, 2008 IP
  3. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #3
    Wordpress searches for posts AND pages.

    Can anyone help me with this?

    EDIT > I don't want to use a plugin. I'd much prefer to hack the WP core files.
     
    Kerosene, Dec 19, 2008 IP
  4. jaob70

    jaob70 Guest

    Messages:
    135
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use the plugin, much easier
     
    jaob70, Dec 20, 2008 IP
  5. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #5
    Thanks for your suggestion. :rolleyes:


    I've solved this anyway. On my site, all posts have a specific custom field - so I just do a quick check for this field, and ignore any search results that don't have it. Job done. No plugin needed. Ugly, but simple. Just like me :p
     
    Kerosene, Dec 21, 2008 IP