Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Hiding unpublished items
- This topic has 5 replies, 2 voices, and was last updated 9 years, 4 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 18, 2017 at 9:51 pm #11644
mook25
ParticipantHI, The search function works great but it seems to also index non published posts and products. I only want it to search products that are published i.e. live, not ones that i am still working on. Is this possible and if so how do I do it.
I have had a look at your knowledge base but can’t seem to find what i am looking for.
January 19, 2017 at 8:45 am #11647Ernest Marcinko
KeymasterHi!
Thanks for the proper details, I have checked the configuration and found the problem.
By default the plugin only looks for published items and nothing else, so I suspected some kind of misconfiguration.
What I have found that on the General Options -> Sources 2 panel you had every taxonomy selected to return as results, which I’m not sure you wanted at all. So the problem most likely was that some taxonomy terms (like tags, categories) were also in the result list, at some of them might had the same names as posts or products.
I simply turned all of them off, tried a few search phrases against unpublished items, but I don’t see any in the results, only published ones, so it should be all right now.
January 19, 2017 at 3:42 pm #11658mook25
ParticipantHi, Thanks for taking a look and your quick response. The search definitely looks a lot cleaner front end than it did before however i noticed that there are still some products showing that shouldn’t be e.g NUMARK N-WAVE 360 DJ Monitor when I type in the search box ‘speakers’.
On further investigation it appears the above example is indexing the Bin so although i could empty the bin and the problem will probably go away, is there a way to stop it indexing this as i don’t always empty the bin sometimes for days at a time?
Thanks again for what is a great product and i will definitely be rating you positive once this is sorted.All logins are the same as before if required.
January 19, 2017 at 4:33 pm #11659Ernest Marcinko
KeymasterHi again!
Indeed, something is not right. I’ve digged more into the problem, and it appears to be a recently discovered WooCommerce bug, whereas trashing a product, will not trash product variations – they stay published in the database. Here is the issue #12774, and apparently they are fixing it within the 4.7 release: fix #12798
However I was able to create a temporary workaround. Just add this code to the functions.php file in your active theme directory:
This will check for orphan variations within the results, and delete them before the output.
January 22, 2017 at 12:26 pm #11677mook25
ParticipantThanks again for outstanding support. I’m off to go rate the product and support now. Good work!
January 23, 2017 at 10:43 am #11680Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Hiding unpublished items’ is closed to new replies.