Tet banner

Custom Fields
Support General Ajax Search and filter template

  • Creator
  • #29969
    Resolved Nicholas Cox


    I was wondering if there is a way to query all posts and return the results using metabox but allow to do this via ajax? so I can use search and filtering via JavaScript to add in infinite scroll etc.

    I know I can query posts via metabox, but is it possible to hook in ajax so I can update search results on the front end of the website? also caching would be a bonus too.

    I can see you do this for object fields in the backend https://metabox.io/meta-box-updates-better-performance-for-object-fields-mb-core-and-new-settings-page/ but was wondering do you do the same for front end search result pages?

    I can see there is a plugin called SearchWP but I am after creating my own scripts as I do not want to use 3rd party plugins.



Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #29974
    Nicholas Cox

    Also I have been checking out using custom API endpoints and using them for search and filter posts. I know Metabox adds fields into the API as I have the addon installed. What are your thoughts on using the wordpress rest api over admin-ajax.php?

    Long Nguyen


    The feature Ajax Search is only supported for the field select_advanced to select the value. We do not handle any search function on the front end. If you want to create a search form on the frontend by using Ajax or Rest API, this article might help you to do that https://sabrinazeidan.com/wp-rest-api-search-with-autocomplete-with-vanilla-js/

    Nicholas Cox

    thanks for the link, very useful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.