WordPress.org

Ready to get started?Download WordPress

Forums

How to get Search to search pages or comments? (30 posts)

  1. CanuckKev
    Member
    Posted 9 years ago #

    I was trying a search tonight and search for a term that I new existed in a comment. No results.

    Next I tried for one on a Page (not a post) and no results.

    So is it possible to get search to search pages and or comments?

  2. motoed
    Member
    Posted 9 years ago #

    I'm having the exact same problem with my site as well. I have this setup on a clients site and they are questioning why "page" content isn't showing up when they search.

    I didn't have a good answer for them.

  3. Grobbo
    Member
    Posted 9 years ago #

    It is probably a heritage from b2 that also never searched the comments. An advanced search option would be nice, you'd have the options to search the comments in all posts belonging to category n.

  4. Michael Adams (mdawaffe)
    Member
    Posted 9 years ago #

    http://mosquito.wordpress.org/view.php?id=538

    Seems like it's on the Todo list.

  5. anup
    Member
    Posted 9 years ago #

    Search does not search the "Page" in the wp 1.5 - at least thats the case as it seems to be.

    - Anup
    http://www.i3pep.org

  6. liampage
    Member
    Posted 9 years ago #

    And it looks like that won't change for the time being: "This is intended behaviour until we revamp search."

    Pity. It's the only reason I upgraded to 1.5...

  7. Kwebble
    Member
    Posted 9 years ago #

    I made a quick hack for WP 1.5 to support searching pages, you might want to try. I've described it at my site:Searching pages in WordPress 1.5.

  8. philpeeps
    Member
    Posted 9 years ago #

    this seems a bit easier than this change...keep us posted.

    http://weblogtoolscollection.com/archives/2005/02/23/advanced-search-for-wordpress-15/

    I will keep my eye on this and might switch over, as right now, BAStats won't log my internal search words...

  9. CanuckKev
    Member
    Posted 9 years ago #

    Kwebble's hack has been turned into a plugin. David at Random Frequency has take Kwebble's hack, that works great, and made it quite easy to do.

    http://randomfrequency.net/wordpress/search-pages/

  10. Jinsan
    Member
    Posted 9 years ago #

    looks great gonna try this out.

    Works great - great stuff

  11. ralph76
    Member
    Posted 9 years ago #

    But still no way to search comments as well?

  12. stinkydad
    Member
    Posted 9 years ago #

    well, i just wrote one here:

    http://www.frorse.com/code/

  13. tchamberlain
    Member
    Posted 9 years ago #

    I must say I been looking for a way to search both pages and posts. I installed this plugin on my WP 1.511 and it seems to work without a problem! No code modifications needed!

    http://randomfrequency.net/wordpress/search-pages/

  14. chweifly
    Member
    Posted 9 years ago #

    WOWï¼? Great work!
    Search-pages + Serch-comments = Perfect!

  15. electrolund
    Member
    Posted 8 years ago #

    chweifly, your formula reduces to:
    2*Search - (pages + comments) = Perfect

    sorry, I'm a math nerd!

  16. Ptryk
    Member
    Posted 8 years ago #

    got a question.. (not possible to ask at the plugin site, .. so.....)

    i have tried to mod the search pages plugin to exclude password protected posts.. want a search function, just don't want to give people the chance to see that there "is" a protected post AND it happens to contain your search words.. from my own pov - it just wets the gums..

    anyhow, i changed the replace "to" section with :

    ' AND ((post_password = "" AND (post_status = "static" OR post_status = "publish"))'

    no problem really .. for pages... posts are another matter. posts that are password protected still show up!? i can't seem to figure out how/why this could possibly be.. enlightenment requested and greatly appreciated!

  17. damino
    Member
    Posted 8 years ago #

    Hi, I've tested the nice plugin search-pages. It's nice now I can find a word in PAGES (static).
    But there's a little bug : I find a word written in my PAGE TOTO (static). This is good but under the seach result it is written "saved (or publised ... I made a translation because I use a French WP) in : BLABLA" and BlaBla is not a PAGE (static), it is a a POST with no link to my PAGE TOTO.

    ??? any idea ? Tanks.

  18. Ptryk
    Member
    Posted 8 years ago #

    damino.. if i getcha... i believe the search of the search-pages plugin doesn't search a specific page.. it just makes it so the search searches pages AND posts.. ALL pages and posts within your database .. no matter where the search is placed.

  19. damino
    Member
    Posted 8 years ago #

    Hi Ptryk,
    Actually to understand : go to http://damien.gayrard.free.fr
    In"Rechercher" type for exemple "damien".
    You will have 2 answers. The first answer ("Les Véhicules Techniques") says : "enregistré dans : Edito" which is false (Edito is a POST). It is in a PAGE here : Menu Principal/Les liens/Les véhicules Techniques.

    Easier to understand my problem ?

  20. Ptryk
    Member
    Posted 8 years ago #

    damino.. as near as i can tell, eventhough pages and posts are NOT the same (it even says it in the codex http://codex.wordpress.org/pages ), they ARE very similar. take a look at the loop to call the content for pages and for posts.. mine are basically the same (i just removed the auto heading and comment garbage since it didn't fit what i wanted). Although, as an aside, i still have no idea why my change regarding protected posts described above is giving differing responses between pages and posts!?

    anyhow, i checked your page , i just don't see why your results are coming out wrong.. so, let me try to say this another way, in the form of "rules" :
    1> the search searches ALL pages and posts you have in your database (the entire database)

    2> the search is NOT limited from where (which page) you initiate the search (possible i am sure by hacking the search pages plugin with your special query code)

    3> the search results are displayed the same as posts (unless you change your search.php to manage different results for different types of posts)\\

    now your example and its results makes sense and follow on each of the rules 1, 2, & 3. what rule change/addition are you expecting?

  21. damino
    Member
    Posted 8 years ago #

    Hi, I do and I understand exactly what you says, but I always have the problem : if the result is in a PAGE I can found it (nice nice !!!) but it's written that this (these) PAGE(S) belongs to the main POST ??? Same result if I made the search from a PAGE or a POST ...

  22. Nom
    Member
    Posted 8 years ago #

    This topic was the top result for "search pages" in WP search, so perhaps appropriate to mention 2.0.

    I am not getting page content results in a 2.0 install. Any developments since August?

  23. Nom
    Member
    Posted 8 years ago #

  24. ctingom
    Member
    Posted 8 years ago #

    So am I understanding this correctly that WordPress doesn't search pages? I'm using 2.0.

  25. moshu
    Member
    Posted 8 years ago #

    WP doesn't search Pages. Not even in 2.0.
    The plugin mentioned above works well in 2.0 for me.

  26. laslo
    Member
    Posted 8 years ago #

    I'm on WP 1.5
    I was using randomfrequency.net/wordpress/search-pages/ and it was working well until some point, i dont know what I changed or what other plugin I add, that search page wont work anymore :(
    Any ideas what conflict would be?

    btw, that plugin I think only looked through Pages not comments. SO if you know any other plugin to search Pages (and comments), let me know so I can try it out.

  27. moshu
    Member
    Posted 8 years ago #

    Any ideas what conflict would be?

    No. The simple do-it-yourself method is: disable the plugins one by one until you find which is conflicting :)
    Don't wait for others to do it for you.

  28. laslo
    Member
    Posted 8 years ago #

    ok, I'm guessing is another plugin that causes the conflict, but I'm not 100% sure.

    btw, this maybe is related to the previous problem, but in the sidebar when I use "echo $s" to show a message indicating what search query was made, it shows an empty string. While in the search it does shows the string..
    for example http://cinencuentro.com/index.php?s=wong+kar+wai

    * my blog is in spanish

    update:
    Ok it's working now. This was the one causing conflicts and the other bug I mentioned before:

    "SimpleSearch 1.0 - Beau Collins - Simply a better search."

    from this site http://beaucollins.com/laboratory/simplesearch/
    which looks it's down. btw, I never saw that plugin made any improvement in the search results, I dont know why I kept using it =P

    That plugin was also blocking the effects of Search Hilite http://www.mediaprojekte.de/blog/

  29. privatestorm
    Member
    Posted 7 years ago #

    The search everything plugin works great. Just one thing that needs to be added: restrict password protected pages from the search results. Maybe something like adding "AND post_password IS NULL" to the mysql where query? I don't know the correct syntax to use to get this to work though.

  30. Timboy
    Member
    Posted 7 years ago #

    Just for people who might want to know, I'm using this plugin in 2.0.4 and it seems to work fine.

    http://randomfrequency.net/wordpress/search-pages/

Topic Closed

This topic has been closed to new replies.

About this Topic