Forums › Forums › Search & Filter Pro › Only show updated items in serach result
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by Trevor.
-
Anonymous(Private) February 15, 2017 at 8:39 am #90212
Hi,
I have a search form that handles a custom post type. The CPT is imported with the plugin WP All import pro and I can see that the items get imported as they should. The problem is that the items do not show in the search result by default. If I update some information on one item and saves it, then the item is displayed in the search result.
Why are the items not included in the search result by default? All the imported items has status “published” but only the ones that are updated manually are displayed.Since there are about 2000 items it will be a tedious work to update them all manually…
Version:
Wordpress 4.7.2
Search & Filter Pro 2.3.2Trevor(Private) February 15, 2017 at 12:51 pm #90303I believe this is an issue with the way WP All Import does things, as I said in this thread:
https://support.searchandfilter.com/forums/topic/will-the-cache-rebuild-automatically/
We have an action that will do this, but it has to be inserted in their plugin’s code to run after each post has been made. Maybe the author can suggest where to put this and the exact code to use.
Anonymous(Private) February 15, 2017 at 1:29 pm #90319Hi,
I’m not so familiar with the cache on the webserver but I can see all the imported items in another page that doesn’t contain the search form and result, which only lists the CPT in an archive page. So the items are available, both in frontend and in backend. It’s just in the page where the search form and search result are displayed that they don’t show up.Is this caused by the cache?
Trevor(Private) February 15, 2017 at 1:35 pm #90322Yes. When a post is created or updated, WordPress broadcasts this to any code that needs to know. Our plugin listens for this and updates the cache for that one post that is either new or changed.
But, when bulk importers bring in posts, they can be coded to bypass the normal WordPress systems and thus any code that needs to know, doesn’t. It strikes me that to circumvent the normal WordPress process is not a good thing. But this is what the import plugin you are using is doing. Not all import plugins do this.
Trevor(Private) February 15, 2017 at 1:46 pm #90330Well, all that is needed is for them to show where that action:
do_action('search_filter_update_post_cache', 23);
Where 23 is the post ID, so my guess is that will have to be replaced by a variable. OR, they may have a filter that can be used to call that do_action.
-
AuthorPosts