Support » Fixing WordPress » Excerpt contents not searched-Possible?

  • On my site, I post articles from various news sources, many of which are free to copy as long as you retain a copyright notice. Others cannot be copied, so this is what I want to do with those so that they are still searchable, but I’m not distributing the article against the terms of the copyright:
    For the regular articles, I will just put the text of them in the contents area. For the copyrighted articles, I want to put the full text of them in the Excerpt area (which is not displayed) and just have the title and link show on the page. I already have this working. See the top article at
    The problem is that the search field, on the News Archives page (which is the default blog index and default search function) does not search the contents of the Excerpt field.
    How can I get the default search funtion to search the article Excerpts and Contents?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Mark (podz)


    Support Maven

    It may, but I’m not sure. I’ll email and ask. Thanks for the link!

    Unfortunately, it searches titles and the main content, but not the excerpt, and then it returns the entire excerpt (which is the copyrighted article, in my case, so unacceptable). I’m going to futz around with it and see if I can modify it to what I need.

    I guess you have to replace other occurences of post_content as well and give it a shot.

    Well, the reason I ask is because it its current state, with just the one change, it seems to search both the content and the excerpt. However, I doubt that there’s redundancy like that in the code, so I guess that there are several cases here. I’m wondering what the terms of the case that I changed are.

    In the current state, the search results are built up using all those loops, so that’s why I suggested what I did to see if it then searches only the excerpt.

    Sorry – I don’t think I was clear above.
    I would prefer it to function like it seems to currently function – that is, search the excerpts and the contents. So, I hope that how it currently seems to be working will not break under certain circumstances. To clarify my question, I am wondering, based on the design of the search loops and my lack of knowledge of the code, is there is a case where it will not work in the manner that is currently is working?
    Maybe there isn’t, but if there is, and somebody can recognize the case by the code that I posted above, then I would just like to be aware of it so that I can inform users of my site.
    I appreciate your help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Excerpt contents not searched-Possible?’ is closed to new replies.