WordPress.org

Ready to get started?Download WordPress

Forums

Search result as XML or JSON (2 posts)

  1. mfiorentino
    Member
    Posted 5 years ago #

    Hello y'all!

    I was just wondering if one somehow could extract the WordPress search results as XML or JSON. It would be extremely neat, since you could use this to implement the "Autosuggest / Autocomplete with Ajax" tool or similar.

    Any suggestions? Does this require digging into the WP php-files or is there an easier way to do it?

    Cheers,
    :-m

  2. angusc
    Member
    Posted 5 years ago #

    I'm looking for the same thing. I want to be able to pass in a search query and receive XML back so that a search from one place can return results from WordPress and another application.

    Looking around, what seems like the best idea is to modify search.php so that it can take a parameter "xml=true" and would send back that format instead. Then the consolidated search can call that URL and blend those results with anything else it wants.

    Does that make the most sense?

Topic Closed

This topic has been closed to new replies.

About this Topic